.comments-widget {
    --comments-line: #e1e4e6;
    --comments-muted: #727b81;
    --comments-text: #263640;
    color: var(--comments-text);
}

.comments-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin: 0 0 1rem;
}

.product-comment-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: auto;
    margin-left: .35rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #687177;
    font-size: .68rem;
    font-weight: 600;
    line-height: 1;
    vertical-align: baseline;
}

.product-comment-count::before {
    content: "·";
    margin-right: .28rem;
    color: #9aa1a5;
    font-size: .9rem;
    font-weight: 400;
    line-height: .7;
}

.comments-toolbar__count .product-comment-count {
    margin-left: .45rem;
    font-size: .66rem;
}

.comments-toolbar__count {
    display: inline-flex;
    align-items: center;
    color: var(--comments-text);
    font-weight: 500;
}

.product-comment-count[hidden] {
    display: none !important;
}

.comments-sort {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    color: var(--comments-muted);
    font-size: .84rem;
}

.comments-sort__button {
    padding: .35rem .55rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.comments-sort__button:hover,
.comments-sort__button:focus {
    background: #f1f2f3;
    color: var(--comments-text);
    outline: 0;
}

.comments-sort__button.is-active {
    background: #eceeef;
    color: var(--comments-text);
}

.comments-toolbar--filters-only {
    justify-content: flex-end;
}

.comments-sort--icons .comments-sort__button--icon {
    position: relative;
    display: inline-flex;
    flex: 0 0 2.25rem;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 2px;
}

.comments-sort--icons .comments-sort__button--icon .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.comments-sort__icon {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.comments-list {
    min-height: 2rem;
}

.comments-empty {
    padding: .6rem 0;
    color: #7b858b;
}

.comment-thread {
    position: relative;
}

.comment-thread + .comment-thread {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--comments-line);
}

.comment-card {
    position: relative;
    padding: 0 0 .15rem;
}

.comment-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .25rem .55rem;
}

.comment-card__author {
    font-weight: 600;
}

.comment-card__email,
.comment-card__date,
.comment-card__status {
    color: var(--comments-muted);
    font-size: .78rem;
}

.comment-card__status {
    padding: .12rem .35rem;
    background: #f0f1f2;
}

.comment-card__text {
    margin-top: .35rem;
    color: #3f4b52;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comment-card--company {
    margin-top: .15rem;
    padding: .72rem .82rem .62rem;
    border-left: 3px solid #fec50e;
    background: #f7f7f5;
}

.comment-card__company {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    color: #263640;
    font-weight: 600;
}

.comment-card__company-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.12rem;
    height: 1.12rem;
    background: #fec50e;
    color: #263640;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
}

.comment-card--company .comment-card__text {
    white-space: normal;
}

.comment-card--company .comment-card__text p {
    margin: 0 0 .55rem;
}

.comment-card--company .comment-card__text p:last-child,
.comment-card--company .comment-card__text ul:last-child,
.comment-card--company .comment-card__text ol:last-child,
.comment-card--company .comment-card__text blockquote:last-child {
    margin-bottom: 0;
}

.comment-card--company .comment-card__text ul,
.comment-card--company .comment-card__text ol {
    margin: .35rem 0 .6rem 1.25rem;
    padding: 0;
}

.comment-card--company .comment-card__text blockquote {
    margin: .45rem 0;
    padding-left: .75rem;
    border-left: 2px solid #cbd0d3;
    color: #59636a;
}

.comment-card--company .comment-card__text a {
    color: #35434c;
    text-decoration: underline;
}

.comment-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .65rem;
    margin-top: .45rem;
}

.comment-action,
.comment-vote {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .2rem 0;
    border: 0;
    background: transparent;
    color: #747d82;
    font-size: .78rem;
    cursor: pointer;
}

.comment-action:hover,
.comment-action:focus,
.comment-vote:hover,
.comment-vote:focus,
.comment-vote.is-active {
    color: #263640;
    outline: 0;
}

.comment-vote__icon {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.comment-replies {
    margin: .8rem 0 0 1.15rem;
    padding-left: .85rem;
    border-left: 1px solid #d7dbde;
}

.comment-replies .comment-card + .comment-card {
    margin-top: .8rem;
    padding-top: .8rem;
    border-top: 1px solid #eef0f1;
}

.comment-reply-toggle {
    margin-top: .55rem;
}

.comment-reply-context {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin: 0 0 .75rem;
    padding: .55rem .7rem;
    border-left: 2px solid #aab1b5;
    background: #f3f4f4;
    color: #60696f;
    font-size: .82rem;
}

.comment-reply-context.is-visible {
    display: flex;
}

.comment-reply-context__cancel {
    flex: 0 0 auto;
    padding: .15rem;
    border: 0;
    background: transparent;
    color: #667076;
    cursor: pointer;
}

.comments-form .form-control:focus {
    border-color: #8d9498 !important;
    box-shadow: 0 0 0 1px rgba(141, 148, 152, .18) !important;
}

.comments-form [type="submit"] {
    width: 100%;
}

@media (max-width: 767px) {
    .comments-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .comments-sort {
        width: 100%;
    }

    .comments-sort__button {
        flex: 1 1 0;
    }

    .comments-toolbar--filters-only {
        align-items: flex-end;
    }

    .comments-toolbar--filters-only .comments-sort--icons {
        align-self: flex-end;
        width: auto;
    }

    .comments-sort--icons .comments-sort__button--icon {
        flex: 0 0 2.25rem;
    }

    .comment-replies {
        margin-left: .45rem;
        padding-left: .65rem;
    }

    .comment-card__email {
        flex-basis: 100%;
    }
}

/* Shared product/blog comment form */
.blog-comments-widget__heading {
    margin: 0 0 1rem;
    color: #243541;
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.25;
}

/* The article comment area must never visually merge with the footer. */
.blog-comments-widget {
    margin-bottom: clamp(2.25rem, 4vw, 4rem);
}

.product-comments-layout {
    align-items: flex-start;
}

.product-comment-form {
    box-sizing: border-box;
    width: 100%;
    padding: 1rem;
    border: 1px solid #e1e4e6;
    background: #f7f7f7;
}

.product-comment-form__heading {
    margin-bottom: .75rem;
    color: #243541;
    font-size: 1.22rem;
    font-weight: 600;
    line-height: 1.25;
}

.product-comment-form__error {
    margin-bottom: .7rem;
    padding: .55rem .65rem;
    border-left: 2px solid #9a7777;
    background: #f7eded;
    color: #745959;
    font-size: .8rem;
}

.product-comment-form__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.product-comment-form .form-group {
    margin-bottom: .65rem;
}

.product-comment-form label {
    display: block;
    margin-bottom: .25rem;
    color: #59636a;
    font-size: .76rem;
    font-weight: 600;
    line-height: 1.35;
}

.product-comment-form .form-control {
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: .55rem .65rem;
    border: 1px solid #d5dadd;
    border-radius: 0;
    background: #fff;
    color: #35434c;
    font-size: .9rem;
}

.product-comment-form textarea.form-control {
    height: auto;
    min-height: 116px;
    line-height: 1.45;
    resize: vertical;
}

.product-comment-form .form-control::placeholder {
    color: #949ba0;
    opacity: 1;
}

.product-comment-form__footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: .65rem;
}

.product-comment-form__captcha {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: stretch;
    gap: .55rem;
    min-width: 0;
}

.product-comment-form__captcha-image {
    display: block;
    box-sizing: border-box;
    width: 110px;
    height: 52px;
    max-width: none;
    border: 1px solid #d5dadd;
    background: #fff;
    object-fit: cover;
}

.product-comment-form__captcha .form-control,
.product-comment-form__submit {
    height: 52px;
}

.product-comment-form__submit {
    width: auto !important;
    min-width: 118px;
    margin: 0;
    padding: .6rem .9rem;
    border: 1px solid #fec50e;
    border-radius: 0;
    background: #fec50e;
    color: #243541;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
}

.product-comment-form__submit:hover,
.product-comment-form__submit:focus {
    border-color: #efb800;
    background: #efb800;
    color: #243541;
    outline: 0;
}

/* Attachment picker */
.comment-photo-upload {
    position: relative;
    margin: 0 0 .75rem;
}

.comment-photo-upload__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.comment-photo-upload__trigger {
    display: flex !important;
    box-sizing: border-box;
    align-items: center;
    gap: .65rem;
    min-height: 54px;
    margin: 0 !important;
    padding: .55rem .7rem;
    border: 1px dashed #c7cdd0;
    background: #fff;
    color: #566168;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.comment-photo-upload__trigger:hover,
.comment-photo-upload__input:focus + .comment-photo-upload__trigger,
.comment-photo-upload.is-dragover .comment-photo-upload__trigger {
    border-color: #8d9498;
    background: #f1f2f2;
}

.comment-photo-upload__icon {
    flex: 0 0 27px;
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.comment-photo-upload__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .08rem;
}

.comment-photo-upload__copy strong {
    color: #35434c;
    font-size: .8rem;
    font-weight: 600;
}

.comment-photo-upload__copy small {
    color: #7a8388;
    font-size: .68rem;
    font-weight: 400;
    line-height: 1.25;
}

.comment-photo-upload__previews {
    display: none;
    grid-template-columns: repeat(5, 58px);
    gap: .45rem;
    margin-top: .55rem;
}

.comment-photo-upload.has-files .comment-photo-upload__previews {
    display: grid;
}

.comment-photo-upload__preview {
    position: relative;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 1px solid #d9dddf;
    background: #fff;
}

.comment-photo-upload__preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-photo-upload__remove {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(38, 54, 64, .82);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

/* Photos inside every level of a comment thread */
.comment-card__photos {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .55rem;
}

.comment-photo {
    display: block;
    width: 92px;
    height: 72px;
    overflow: hidden;
    border: 1px solid #dde1e3;
    background: #f4f5f5;
    cursor: zoom-in;
}

.comment-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .18s ease;
}

.comment-photo:hover img,
.comment-photo:focus img {
    transform: scale(1.025);
}

/* Lightweight accessible photo viewer */
.comment-lightbox[hidden] {
    display: none !important;
}

.comment-lightbox {
    position: fixed;
    z-index: 12000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 4.5rem;
    background: rgba(17, 22, 25, .92);
}

.comment-lightbox-open {
    overflow: hidden;
}

.comment-lightbox__stage {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.comment-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .28);
}

.comment-lightbox__close,
.comment-lightbox__arrow {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    opacity: .86;
}

.comment-lightbox__close:hover,
.comment-lightbox__close:focus,
.comment-lightbox__arrow:hover,
.comment-lightbox__arrow:focus {
    opacity: 1;
    outline: 0;
}

.comment-lightbox__close {
    top: 1rem;
    right: 1.2rem;
    width: 44px;
    height: 44px;
    font-size: 2rem;
    font-weight: 200;
}

.comment-lightbox__arrow {
    top: 50%;
    width: 48px;
    height: 64px;
    margin-top: -32px;
    font-size: 3rem;
    font-weight: 200;
}

.comment-lightbox__arrow--previous { left: .75rem; }
.comment-lightbox__arrow--next { right: .75rem; }

.comment-lightbox__counter {
    position: absolute;
    right: 1.25rem;
    bottom: 1rem;
    color: rgba(255, 255, 255, .78);
    font-size: .8rem;
}

@media (max-width: 991px) {
    .blog-comments-widget__heading {
        font-size: 1.25rem;
    }

    .product-comment-form-wrap {
        margin-top: .55rem;
    }

    .product-comment-form__fields,
    .product-comment-form__footer {
        grid-template-columns: 1fr;
    }

    .product-comment-form .form-control {
        font-size: 16px;
    }

    .product-comment-form__submit {
        width: 100% !important;
    }
}

@media (max-width: 575px) {
    .product-comment-form {
        padding: .8rem;
    }

    .comment-photo-upload__previews {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: .35rem;
    }

    .comment-photo-upload__preview {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .comment-photo {
        width: 78px;
        height: 64px;
    }

    .comment-lightbox {
        padding: 3.4rem .75rem 2.8rem;
    }

    .comment-lightbox__arrow {
        width: 44px;
        height: 56px;
        background: rgba(22, 28, 31, .28);
        font-size: 2.5rem;
    }

    .comment-lightbox__arrow--previous { left: 0; }
    .comment-lightbox__arrow--next { right: 0; }
}
