.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}
/* Reduce the vertical gap between the page header and product details on product pages */
.product-details {
    padding-top: 30px !important;
}
@media (max-width: 991px) {
    .product-details {
        padding-top: 18px !important;
    }
}
.product-gallery__main {
    background: var(--crank-white);
    border: 1px solid rgba(18, 18, 18, 0.08);
    border-radius: 24px;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    height: auto;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 37, 29, 0.08);
}
.product-gallery__main-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: cover;
    border-radius: 14px;
}
.product-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
}
.product-gallery__thumb {
    appearance: none;
    border: 2px solid transparent;
    background: var(--crank-white);
    border-radius: 16px;
    padding: 4px;
    width: 76px;
    height: 76px;
    overflow: hidden;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}
.product-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}
.product-gallery__thumb:hover,
.product-gallery__thumb.is-active {
    border-color: var(--crank-base);
    box-shadow: 0 12px 24px rgba(var(--crank-base-rgb), 0.18);
    transform: translateY(-2px);
}
.product-meta-card {
    background: linear-gradient(135deg, #0f3825 0%, #1b5537 100%);
    color: var(--crank-white);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 24px 60px rgba(15, 37, 29, 0.18);
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-meta-card__eyebrow {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}
.product-meta-card__title {
    margin: 0 0 16px;
    font-size: 30px;
    line-height: 1.15;
    color: var(--crank-white);
}
.product-meta-card__text {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.88);
}
.product-meta-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.product-meta-card__list li {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.product-meta-card__list li:last-child {
    border-bottom: 0;
}
.product-meta-card__list span {
    color: rgba(255, 255, 255, 0.72);
}
.product-meta-card__list strong {
    color: var(--crank-white);
    font-weight: 600;
    text-align: right;
}
.product-meta-card .thm-btn {
    width: 100%;
    margin-top: 22px;
    justify-content: center;
}
.product-meta-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 24px;
    margin-top: auto; /* push actions to bottom when card stretches */
}
.product-meta-card__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--crank-white);
    border-radius: 999px;
    padding: 10px 18px;
    background: rgba(var(--crank-white-rgb), 0.08);
    border: 1px solid rgba(var(--crank-white-rgb), 0.16);
    text-decoration: none;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}
.product-meta-card__link:hover {
    background: rgba(var(--crank-white-rgb), 0.14);
    border-color: rgba(var(--crank-white-rgb), 0.24);
}
/* Collapsible product details shown in the meta card */
.product-meta-card__details {
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.product-meta-card__details-title {
    margin: 0 0 16px 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.95);
}
.product-meta-card__details .details-text {
    margin: 0;
    line-height: 1.6;
}
.product-meta-card__details .details-text.clamped {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-meta-card__details .details-text.expanding {
    display: block;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.product-meta-card__details-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(var(--crank-white-rgb), 0.06);
    color: var(--crank-white);
    border: 1px solid rgba(var(--crank-white-rgb), 0.12);
    font-weight: 700;
    cursor: pointer;
    transition:
        background 160ms ease,
        transform 120ms ease,
        box-shadow 120ms ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    margin: 12px auto 0;
    align-self: center;
    width: 50%;
    min-width: 0;
    max-width: none;
    font-size: 0.95rem;
    justify-self: center;
    box-sizing: border-box;
}
.product-meta-card__details-toggle:hover {
    background: rgba(var(--crank-white-rgb), 0.12);
    transform: translateY(-1px);
}
.product-meta-card__details-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(var(--crank-base-rgb), 0.14);
}
.product-description__title {
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
}
.product-description__text1 {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.9;
    color: var(--crank-gray);
}
/* Product category listing grid */
.product-catalog {
    padding-top: 40px;
    padding-bottom: 100px;
}
.product-catalog__count {
    margin-bottom: 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(23, 23, 23, 0.55);
}
.product-card {
    display: flex;
    flex-direction: column;
    height: calc(100% - 30px);
    margin-bottom: 30px;
    background: var(--crank-white);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(15, 37, 29, 0.08);
    border: 1px solid rgba(18, 18, 18, 0.06);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(15, 37, 29, 0.16);
}
.product-card__img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4f6f5;
}
.product-card__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.product-card:hover .product-card__img img {
    transform: scale(1.08);
}
.product-card__img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(23, 23, 23, 0.2);
    font-size: 42px;
}
.product-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f3825;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 6px 14px rgba(15, 37, 29, 0.14);
}
.product-card__content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 24px 26px 26px;
}
.product-card__title {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.35;
    color: var(--crank-black);
    transition: color 0.2s ease;
}
.product-card:hover .product-card__title {
    color: var(--crank-base);
}
.product-card__text {
    margin: 0 0 18px;
    font-size: 14px;
    color: rgba(23, 23, 23, 0.65);
    line-height: 1.75;
    flex: 1 1 auto;
}
.product-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
    color: #0f3825;
    margin-top: auto;
}
.product-card__link .icon-arrow-up-right {
    display: inline-flex;
    transition: transform 0.2s ease;
}
.product-card:hover .product-card__link {
    color: var(--crank-base);
}
.product-card:hover .product-card__link .icon-arrow-up-right {
    transform: translate(3px, -3px);
}
.product-catalog__empty {
    text-align: center;
    padding: 70px 20px;
    border-radius: 20px;
    background: #f7f9f8;
    border: 1px dashed rgba(18, 18, 18, 0.14);
}
.product-catalog__empty .icon-folder {
    display: block;
    font-size: 40px;
    color: rgba(23, 23, 23, 0.25);
    margin-bottom: 16px;
}
.product-catalog__empty p {
    margin-bottom: 20px;
    color: rgba(23, 23, 23, 0.65);
}
@media (max-width: 767px) {
    .product-catalog {
        padding-top: 24px;
        padding-bottom: 60px;
    }
    .product-card__content {
        padding: 20px 20px 22px;
    }
}
.related-products__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding-top: 6px;
    padding-bottom: 6px;
}
.related-products__heading .section-title-two__title {
    margin-bottom: 0;
}
.related-products__heading .gallery-four__text {
    margin-bottom: 0;
    max-width: 520px;
}
.related-products .testimonial-one__single {
    height: 100%;
}
.related-products .testimonial-one__img img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
/* Spacing container for Related Products section (desktop + mobile adjustments) */
.related-products,
.testimonial-page.related-products {
    margin-top: 32px;
    margin-bottom: 24px;
    padding-top: 6px;
    padding-bottom: 6px;
}
@media (max-width: 991px) {
    .related-products__heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
        padding-top: 4px;
        padding-bottom: 4px;
    }
    .related-products,
    .testimonial-page.related-products {
        margin-top: 12px;
        margin-bottom: 8px;
    }
}
@media (max-width: 991px) {
    .product-meta-card {
        margin-top: 12px;
    }
    .product-gallery__main {
        width: 100%;
        height: auto;
        padding: 12px;
    }
    .product-gallery__main-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        border-radius: 12px;
    }
    .product-gallery {
        width: 100%;
    }
    /* Reduce vertical gap between stacked columns and between sections on mobile */
    .product-details {
        margin-bottom: 12px !important;
    }
    .product-details .row {
        --bs-gutter-y: 12px !important;
        row-gap: 12px !important;
        gap: 12px 1rem !important;
    }
}
/* Make the gallery column auto-width and let the details column grow to fill remaining space
   Target any Bootstrap column classes so this applies to both legacy `product.php` and modern view */
.product-details .row > [class*="col-"]:first-child {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
}
.product-details .row > [class*="col-"]:last-child {
    flex: 1 1 0% !important;
    min-width: 0 !important; /* allow shrinking */
}
@media (max-width: 991px) {
    .product-details .row > [class*="col-"]:first-child,
    .product-details .row > [class*="col-"]:last-child {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}
/* Ensure the details column grows to fill remaining space next to the auto-width gallery */
.product-details .row > .col-lg-auto {
    flex: 0 0 auto;
    width: auto;
}
.product-details .row > .col {
    flex: 1 1 0%;
    min-width: 0; /* allow flex children to shrink */
}
/* Ensure product-details rows stretch columns so meta card matches gallery height */
.product-details .row {
    align-items: stretch !important;
}
/* Related Products Cards */
.related-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--crank-white);
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    border: 1px solid rgba(18, 18, 18, 0.06);
    transition:
        transform 0.3s ease;
}
.related-product-card:hover {
    transform: translateY(-6px);
}
.related-product-card__img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4f6f5;
}
.related-product-card__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.related-product-card:hover .related-product-card__img img {
    transform: scale(1.08);
}
.related-product-card__img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(23, 23, 23, 0.2);
    font-size: 42px;
}
.related-product-card__content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 24px 26px 26px;
}
.related-product-card__title {
    margin: 0 0 16px;
    font-size: 20px;
    line-height: 1.35;
    color: var(--crank-black);
    font-weight: 600;
    transition: color 0.2s ease;
    flex: 1 1 auto;
}
.related-product-card:hover .related-product-card__title {
    color: var(--crank-base);
}
.related-product-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
    color: #0f3825;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: auto;
    transition: color 0.2s ease;
}
.related-product-card__link .icon-arrow-up-right {
    display: inline-flex;
    transition: transform 0.2s ease;
}
.related-product-card:hover .related-product-card__link {
    color: var(--crank-base);
}
.related-product-card:hover .related-product-card__link .icon-arrow-up-right {
    transform: translate(3px, -3px);
}
@media (max-width: 767px) {
    .related-product-card__content {
        padding: 20px 20px 22px;
    }
    .related-product-card__title {
        font-size: 16px;
        margin-bottom: 12px;
    }
}
