/* ---------- Product Detail Page ---------- */

/* ---- Breadcrumbs ---- */
.pdp-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0 !important;
    margin: 20px 0;
    font-size: 14px;
    color: var(--color-text);
    overflow-x: auto;
    white-space: nowrap;
}

.pdp-breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pdp-breadcrumbs li:not(:last-child)::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 10px;
    background: url("/static/projects/bricomol.md/assets/img/icons/arrow-right-short.svg") center / contain no-repeat;
    flex-shrink: 0;
}

/* ---- Product Detail Layout ---- */
.pdp {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

/* ---- Gallery ---- */
.pdp-gallery {
    position: relative;
    min-width: 0;
}

.pdp-gallery__main {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.pdp-gallery__main .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 24px;
}

.pdp-gallery__main .swiper-slide img {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
}

.pdp-gallery__main .swiper-button-prev,
.pdp-gallery__main .swiper-button-next {
    --swiper-navigation-size: 0;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    top: 50%;
    z-index: 10;
}

.pdp-gallery__main .swiper-button-prev { left: 12px; }
.pdp-gallery__main .swiper-button-next { right: 12px; }

.pdp-gallery__main .swiper-button-prev::after,
.pdp-gallery__main .swiper-button-next::after {
    content: "";
    width: 10px;
    height: 10px;
    display: block;
}

.pdp-gallery__main .swiper-button-prev::after {
    border-left: 2px solid #333;
    border-bottom: 2px solid #333;
    transform: rotate(45deg);
    margin-left: 4px;
}

.pdp-gallery__main .swiper-button-next::after {
    border-right: 2px solid #333;
    border-top: 2px solid #333;
    transform: rotate(45deg);
    margin-right: 4px;
}

/* Thumbnails */
.pdp-gallery__thumbs {
    position: relative;
}

.pdp-gallery__thumbs .swiper-slide {
    height: 80px;    
    border-radius: 8px;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    padding: 4px;
    transition: border-color 0.2s;
}

.pdp-gallery__thumbs .swiper-slide-thumb-active {
    border-color: var(--color-green-main);
}

.pdp-gallery__thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Thumbnails wrapper with overflow counter */
.pdp-gallery__thumbs-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdp-gallery__thumbs-wrap .pdp-gallery__thumbs {
    flex: 1;
    min-width: 0;
}

/* Overflow counter for extra images */
.pdp-gallery__thumbs-overflow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background: var(--color-grey-light);
    border: 2px solid #E5E7EB;
    font-weight: var(--font-weight-bold);
    font-size: 18px;
    color: #6B7280;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pdp-gallery__thumbs-overflow:hover {
    border-color: var(--color-green-main);
    color: var(--color-green-main);
}

/* ---- Product Info ---- */
.pdp-info {
    position: relative;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.pdp-info__badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pdp-info__discount {
    display: inline-flex;
    align-items: center;
    background: var(--color-rose);
    color: #fff;
    font-weight: var(--font-weight-bold);
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 4px;
}

.pdp-info__wishlist {
    width: 44px;
    height: 44px;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.pdp-info__wishlist:hover {
    border-color: var(--color-rose);
}

.pdp-info__wishlist svg {
    width: 18px;
    height: 18px;
}

.pdp-info__wishlist.active .heart-filled {
    color: var(--color-rose);
}

.pdp-info__title {
    font-weight: var(--font-weight-semibold);
    font-size: 32px;
    line-height: 38px;
    color: var(--color-text);
    margin: 0 0 16px;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Stock badge */
.pdp-info__stock {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 16px;
    line-height: 20px;
    font-weight: var(--font-weight-medium);
    margin-bottom: 18px;
}

.pdp-info__stock--in {
    color: var(--color-green-main);
}

.pdp-info__stock--out {
    color: var(--color-rose);
}

.pdp-info__stock svg {
    width: 18px;
    height: 18px;
}

/* Price */
.pdp-info__price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.pdp-info__price-old {
    font-size: 16px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.pdp-info__price-current {
    font-weight: var(--font-weight-semibold);
    font-size: 28px;
    color: var(--color-green-main);
}

/* Add to cart row */
.pdp-info__cart-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.pdp-info__cart-row--disabled {
    opacity: 0.7;
    pointer-events: none;
}

.pdp-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #CAD0D9;
    border-radius: 8px;
    overflow: hidden;
    height: 48px;
    background: #EEF1F6;
}

.pdp-qty__btn {
    width: 40px;
    height: 100%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    background: #EEF1F6;
}

.pdp-qty__input {
    width: 44px;
    height: 100%;
    border: none;
    text-align: center;
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    color: var(--color-text);
    -moz-appearance: textfield;
    background: #EEF1F6;
}

.pdp-qty__input::-webkit-outer-spin-button,
.pdp-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pdp-info__add-btn {
    flex: 1;
    min-width: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--color-green-main);
    color: #ffffff;
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: 16px;
    line-height: 20px;
    height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.pdp-info__add-btn .btn-cart_success {
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background-color: #313130;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.pdp-info__add-btn.in-cart > * {
    opacity: 0;
}

.pdp-info__add-btn.in-cart .btn-cart_success {
    transform: translateY(0);
    opacity: 1;
}

/* Characteristics table */

.pdp-specs__title {
    font-weight: var(--font-weight-bold);
    font-size: 20px;
    color: var(--color-text);
    margin-bottom: 18px;
}

.pdp-specs__table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.pdp-specs__table tr + tr td {
    border-top: 1px solid #F0F2F3;
}

.pdp-specs__table td {
    padding: 10px 0;
    font-size: 16px;
    vertical-align: top;
}

.pdp-specs__table td:first-child {
    color: #6B7280;
    width: 45%;
    padding-right: 16px;
    word-break: break-word;
}

.pdp-specs__table td:last-child {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
    text-align: right;
    word-break: break-word;
}

/* Free delivery banner */
.pdp-delivery-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ACCBEE4D;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #2F6ED5;
}

.pdp-delivery-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.pdp-delivery-banner strong {
    font-weight: var(--font-weight-semibold);
}

/* ---- Tabs ---- */
.pdp-tabs {
    margin-bottom: 40px;
}

.pdp-tabs__nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #F0F2F3;
    margin-bottom: 0;
}

.pdp-tabs__nav-item {
    padding: 14px 24px;
    font-weight: var(--font-weight-medium);
    font-size: 16px;
    line-height: 20px;
    color: var(--color-text);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-family);
}

.pdp-tabs__nav-item:hover {
    color: var(--color-text);
}

.pdp-tabs__nav-item.active {
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
    border-bottom-color: var(--color-green-main);
}

.pdp-tabs__panel {
    display: none;
    padding: 24px 0;
}

.pdp-tabs__panel.active {
    display: block;
}

.pdp-tabs__panel p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    white-space: pre-wrap;
}

.pdp-tabs__empty {
    color: var(--color-text-muted);
    font-style: italic;
}

/* ---- Properties Grid ---- */
.pdp-props-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    padding: 4px 0;
}

.pdp-props-grid__card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border: 1px solid var(--color-grey-light);
    border-radius: 8px;
}

.pdp-props-grid__label {
    font-size: 12px;
    color: var(--color-green-main);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pdp-props-grid__value {
    font-size: 15px;
    font-weight: var(--font-weight-regular);
    color: var(--color-text);
}


/* ---- Reviews Section ---- */
.pdp-reviews {
    padding: 0;
}

.pdp-reviews__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.pdp-reviews__title {
    font-weight: var(--font-weight-semibold);
    font-size: 24px;
    line-height: 20px;
    color: var(--color-text);
    margin: 0;
}

.pdp-reviews__add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.pdp-reviews__add-btn:hover {
    border-color: var(--color-green-main);
}

.pdp-reviews__add-btn svg {
    width: 16px;
    height: 16px;
}

/* Rating summary */
.pdp-reviews__summary {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 32px;
    padding: 24px;
    background: #FAFAFA;
    border-radius: 12px;
}

.pdp-reviews__avg {
    text-align: center;
    flex-shrink: 0;
    min-width: 100px;
}

.pdp-reviews__avg-number {
    font-weight: var(--font-weight-bold);
    font-size: 48px;
    line-height: 1;
    color: var(--color-text);
    margin-bottom: 12px;
}

.pdp-reviews__avg-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 4px;
}

.pdp-reviews__avg-count {
    font-size: 14px;
    line-height: 22px;
    color: var(--color-text);
    font-weight: var(--font-weight-regular);
}

/* Star icons */
.pdp-star {
    width: 18px;
    height: 18px;
    display: inline-block;
}

.pdp-star--filled { color: #F5A623; }
.pdp-star--half { color: #F5A623; }
.pdp-star--empty { color: #D1D5DB; }

/* Rating bars */
.pdp-reviews__bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdp-reviews__bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdp-reviews__bar-label {
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    min-width: 24px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.pdp-reviews__bar-label svg {
    width: 14px;
    height: 14px;
    color: #F5A623;
}

.pdp-reviews__bar-track {
    flex: 1;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.pdp-reviews__bar-fill {
    height: 100%;
    background: var(--color-green-main);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.pdp-reviews__bar-count {
    font-size: 13px;
    color: #6B7280;
    min-width: 24px;
    text-align: right;
}

/* Review cards */
.pdp-review-card {
    padding: 20px 0;
    border-bottom: 1px solid #F0F2F3;
}

.pdp-review-card:last-child {
    border-bottom: none;
}

.pdp-review-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pdp-review-card__author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdp-review-card__name {
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    line-height: 24px;
    color: var(--color-text);
}

.pdp-review-card__verified {
    width: 18px;
    height: 18px;
    color: var(--color-blue);
}

.pdp-review-card__date {
    font-size: 14px;
    line-height: 22px;
    color: var(--color-text);
}

.pdp-review-card__stars {
    display: flex;
    gap: 2px;
    margin-bottom: 10px;
}

.pdp-review-card__text {
    font-size: 14px;
    line-height: 22px;
    color: var(--color-text);
    margin-bottom: 12px;
    font-weight: var(--font-weight-regular);
}

.pdp-review-card__images {
    display: flex;
    gap: 8px;
}

.pdp-review-card__img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.pdp-review-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Reviews pagination */
.pdp-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
}

.pdp-pagination__item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: #6B7280;
    text-decoration: none;
    transition: all 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-family);
}

.pdp-pagination__item:hover {
    background: var(--color-grey-light);
    color: var(--color-text);
}

.pdp-pagination__item.active {
    background: var(--color-green-main);
    color: #fff;
}

.pdp-pagination__ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 14px;
    color: #6B7280;
}

/* ---- Similar & Suggestions Sections ---- */
.pdp-section {
    margin-top: 60px;
    margin-bottom: 100px;
}

.pdp-section__title {
    font-weight: var(--font-weight-semibold);
    font-size: 44px;
    line-height: 36px;
    color: var(--color-text);
    margin-bottom: 50px;
}

.pdp-carousel {
    position: relative;
}

.pdp-carousel .swiper-button-prev { left: 0; }
.pdp-carousel .swiper-button-next { right: 0; }

/* ---- Review Form (modal-style inline) ---- */
.pdp-review-form {
    padding: 32px 0;
}

.pdp-review-form__title {
    font-weight: var(--font-weight-semibold);
    font-size: 20px;
    color: var(--color-text);
    margin-bottom: 8px;
}

.pdp-review-form__subtitle {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 10px;
}

.pdp-review-form .star-rating {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    gap: 4px;
}

.pdp-review-form .star-rating img{
    width: 20px;
    height: 20px;
}

.pdp-review-form .star-rating .star-rating_item {
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.pdp-form-group {
    margin-bottom: 16px;
}

.pdp-form-group__label {
    display: block;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: 6px;
}

.pdp-form-group__label--req::after {
    content: " *";
    color: var(--color-rose);
}

.pdp-form-group__input,
.pdp-form-group__textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--color-text);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pdp-form-group__input:focus,
.pdp-form-group__textarea:focus {
    outline: none;
    border-color: var(--color-green-main);
}

.pdp-form-group__textarea {
    min-height: 120px;
    resize: vertical;
}

.pdp-form-group__error {
    display: none;
    font-size: 12px;
    color: var(--color-rose);
    margin-top: 4px;
}

.pdp-review-form__submit {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--color-green-main);
    color: #fff;
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold);
    font-size: 16px;
    padding: 14px 40px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: opacity 0.2s;
}

.pdp-review-form__submit:hover {
    opacity: 0.9;
}

.pdp-review-form__login-prompt {
    text-align: center;
    padding: 24px 0;
}

.pdp-review-form__login-prompt p {
    margin-bottom: 16px;
    color: #666;
    font-size: 15px;
}

.pdp-review-form__login-btn {
    display: inline-block;
    background: var(--color-green-main);
    color: #fff;
    font-weight: var(--font-weight-semibold);
    font-size: 15px;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.pdp-review-form__login-btn:hover {
    opacity: 0.9;
    color: #fff;
}

.star-rating.has-error {
    outline: 2px solid #dc3545;
    outline-offset: 4px;
    border-radius: 4px;
}
.pdp-form-group.has-error textarea {
    border-color: #dc3545;
}

/* Review pagination */
.pdp-reviews__page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    margin: 0 2px;
}
.pdp-reviews__page-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* ---- Responsive ---- */

@media (max-width: 1450px) {
    .pdp-breadcrumbs {
        margin-top: 40px;
    }
}

@media (max-width: 991px) {
    .pdp {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .pdp-gallery__main .swiper-slide {
        min-height: 300px;
    }

    .pdp-info__title {
        font-size: 22px;
        line-height: 28px;
    }

    .pdp-info__price-current {
        font-size: 24px;
    }

    .pdp-specs__table td {
        font-size: 14px;
    }

    .pdp-reviews__summary {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }

    .pdp-reviews__avg {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .pdp-reviews__avg-stars {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .pdp-info__title {
        font-size: 18px;
        line-height: 24px;
    }

    .pdp-info__price-current {
        font-size: 20px;
    }

    .pdp-info__price-old {
        font-size: 14px;
    }

    .pdp-info__cart-row {
        flex-direction: row;
    }

    .pdp-qty {
        width: auto;
        justify-content: flex-start;
    }

    .pdp-info__add-btn {
        width: auto;
        padding : 14px 0;
    }

    .pdp-specs__title {
        font-size: 16px;
    }

    .pdp-specs__table td:first-child {
        width: 40%;
    }

    .pdp-section {
        margin-top: 32px;
        margin-bottom: 60px;
    }

    .pdp-section__title {
        font-size: 20px;
    }

    .pdp-carousel .swiper-button-prev,
    .pdp-carousel .swiper-button-next {
        display: none;
    }

    .pdp-reviews__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pdp-gallery__thumbs .swiper-slide {
        width: 60px !important;
        height: 60px;
    }

    .pdp-gallery__thumbs-overflow {
        width: 60px;
        height: 60px;
    }

    .pdp-breadcrumbs {
        font-size: 12px;
        gap: 4px;
    }

    .pdp-delivery-banner {
        font-size: 13px;
        padding: 10px 12px;
        margin-top: 10px;
    }

    .pdp-tabs__nav-item {
        padding: 10px 14px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pdp-info__stock {
        font-size: 14px;
    }

    .pdp-specs__table td {
        font-size: 13px;
        padding: 8px 0;
    }

    .pdp-gallery__main .swiper-slide {
        min-height: 240px;
        padding: 16px;
    }

    .pdp-gallery__main .swiper-slide img {
        max-height: 260px;
    }
}
