/* Template: List */
.amazon-products[data-template="list"] {
    display: flex;
    flex-direction: column;
}

.amazon-products[data-template="list"] > :not(:last-child) {
    margin-bottom: 1.5rem;
}

.amazon-products[data-template="list"] .amazon-product {
    display: flex;
    flex-direction: row;
}

.amazon-products[data-template="list"] .amazon-product > :not(:last-child) {
    margin-right: 0.75rem;
}

.amazon-products[data-template="list"] .amazon-product-thumbnail {
    height: 6rem;
    width: 6rem;
    overflow: hidden;
    display: flex;
    flex: none;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: #f3f4f6;
}

.amazon-products[data-template="list"] .amazon-product-thumbnail img {
    height: 100%;
    width: 100%;
    object-fit: scale-down;
}

.amazon-products[data-template="list"] .amazon-product-content {
    flex: 1;
}

.amazon-products[data-template="list"] .amazon-product-title {
    line-clamp: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amazon-products[data-template="list"] .amazon-product-button {
    margin-top: 0.5rem;
}

.amazon-products[data-template="list"] .amazon-product-button a {
    width: 100%;
    max-width: 12rem;
}

.amazon-products[data-template="list"] .amazon-product-price {
    font-size: 1.25rem;
    font-weight: 500;
}

.amazon-products[data-template="list"] .amazon-product-ratings {
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* Template: Grid */
.amazon-products[data-template="grid_1x"],
.amazon-products[data-template="grid_2x"],
.amazon-products[data-template="grid_3x"] {
    display: grid;
    grid-gap: 1.5rem;
}

.amazon-products[data-template="grid_1x"] {
    grid-template-columns: repeat(1, 1fr);
}

.amazon-products[data-template="grid_2x"] {
    grid-template-columns: repeat(2, 1fr);
}

.amazon-products[data-template="grid_3x"] {
    grid-template-columns: repeat(3, 1fr);
}

.amazon-products[data-template="grid_3x"] .amazon-product,
.amazon-products[data-template="grid_2x"] .amazon-product,
.amazon-products[data-template="grid_1x"] .amazon-product {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.amazon-products[data-template="grid_3x"] .amazon-product-content,
.amazon-products[data-template="grid_2x"] .amazon-product-content,
.amazon-products[data-template="grid_1x"] .amazon-product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.amazon-products[data-template="grid_3x"] .amazon-product-thumbnail,
.amazon-products[data-template="grid_2x"] .amazon-product-thumbnail,
.amazon-products[data-template="grid_1x"] .amazon-product-thumbnail {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    flex: none;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    background-color: #f3f4f6;
}

.amazon-products[data-template="grid_3x"] .amazon-product-thumbnail img,
.amazon-products[data-template="grid_2x"] .amazon-product-thumbnail img,
.amazon-products[data-template="grid_1x"] .amazon-product-thumbnail img {
    height: 100%;
    width: 100%;
    object-fit: scale-down;
}

.amazon-products[data-template="grid_3x"] .amazon-product-title,
.amazon-products[data-template="grid_2x"] .amazon-product-title,
.amazon-products[data-template="grid_1x"] .amazon-product-title {
    margin-top: 0.75rem;
    line-clamp: 3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.amazon-products[data-template="grid_3x"] .amazon-product-price,
.amazon-products[data-template="grid_2x"] .amazon-product-price,
.amazon-products[data-template="grid_1x"] .amazon-product-price {
    font-size: 1.25rem;
    font-weight: 500;
}

.amazon-products[data-template="grid_3x"] .amazon-product-button,
.amazon-products[data-template="grid_2x"] .amazon-product-button,
.amazon-products[data-template="grid_1x"] .amazon-product-button {
    margin-top: 0.5rem;
    width: 100%;
}

.amazon-products[data-template="grid_3x"] .amazon-product-button a,
.amazon-products[data-template="grid_2x"] .amazon-product-button a,
.amazon-products[data-template="grid_1x"] .amazon-product-button a {
    width: 100%;
}

/* Global styles */
.amazon-products .amazon-product-ratings > :not(:last-child) {
    margin-right: 0.5rem;
}

.amazon-products .amazon-product-stars {
    display: inline-flex;
    flex-direction: row;
}

.amazon-products .amazon-product-stars > :not(:last-child) {
    margin-right: 0.125rem;
}

.amazon-products .amazon-product-star-half {
    height: 1.25rem;
    width: 1.25rem;
    position: relative;
}

.amazon-products .amazon-product-stars svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.amazon-products .amazon-product-stars svg[data-type="full"] {
    fill: var(--otomatic-ai-amazon-products-star-color, #de7921);
    stroke: var(--otomatic-ai-amazon-products-star-color, #de7921);
}

.amazon-products .amazon-product-stars svg[data-type="empty"] {
    fill: none;
    stroke: var(--otomatic-ai-amazon-products-star-color, #de7921);
}

.amazon-products .amazon-product-star-half svg[data-type="half-left"] {
    position: absolute;
    left: 0;
    top: 0;
    fill: var(--otomatic-ai-amazon-products-star-color, #de7921);
    stroke: var(--otomatic-ai-amazon-products-star-color, #de7921);
}

.amazon-products .amazon-product-star-half svg[data-type="half-right"] {
    position: absolute;
    right: 0;
    top: 0;
    fill: none;
    stroke: var(--otomatic-ai-amazon-products-star-color, #de7921);
    transform: scale(calc(100% * -1), 1);
}

.amazon-products .amazon-product-button a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 0.5rem;
    outline: none;
    background-color: var(--otomatic-ai-amazon-products-button-color, #ff9900);
    height: 2.25rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--otomatic-ai-amazon-products-button-color-foreground, #fff);
}

.amazon-products .amazon-product-button a:hover {
    background-color: var(--otomatic-ai-amazon-products-button-color-hover, #ff9900cc);
}

.amazon-products .amazon-product-button a svg {
    width: 1.25rem;
    height: 1.25rem;
}
