/*
 * Product tile (product/card.phtml), shared by the category/search grid (listview.css) and the Codazon product
 * sliders (layout handle galaxy_listview_cards). Square image, name, price, "or Rs X/month over [30] months*";
 * the whole card is one link. Colours match the product page.
 */
.glv-item {
    position: relative;
    display: flex;
    flex-direction: column;
}
.glv-item .glv-card,
.glv-item .glv-card:visited,
.glv-item .glv-card:hover {
    display: flex;
    flex-direction: column;
    color: #1d1d1f;
    text-decoration: none !important;
}

/* square image */
.glv-item .glv-img {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    border: 1px solid #e3e3e6;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}
.glv-item .glv-img img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    padding: 8%;
    box-sizing: border-box;
    object-fit: contain;
    opacity: 1 !important; /* the homepage theme fades the photo out on hover to show a second image, which we hide */
}
.glv-item .glv-img .hovered-img {
    display: none !important;
}

/* labels: the product page's pills, smaller, top-left of the image; they wrap rather than stack. Not clickable */
/* (.product-items prefix: the homepage sliders sit in .product-list-style-28, whose custom-styles rule unsets the position) */
.product-items .glv-item > .cdz-product-labels {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    right: 8px !important;
    gap: 4px;
    text-align: left !important;
    z-index: 3;
    pointer-events: none;
}
.product-items .glv-item > .cdz-product-labels .label-content {
    font-size: 11px !important;
    padding: 4px 10px !important;
}
@media (max-width: 767px) {
    .product-items .glv-item > .cdz-product-labels .label-content {
        font-size: 9px !important;
        padding: 2px 7px !important;
        letter-spacing: .02em;
    }
}

/* name, price, monthly */
.glv-item .glv-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    margin: 12px 0 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #1d1d1f; /* not the theme's grey for visited links */
}
/* hover (mouse only): the tile lifts slightly and the photo eases in; keyboard focus gets an outline */
.glv-item .glv-img {
    transition: border-color .2s ease, box-shadow .2s ease;
}
.glv-item .glv-img img {
    transition: transform .35s ease;
}
@media (hover: hover) {
    .glv-item .glv-card:hover .glv-img {
        border-color: #c9c9cd;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    }
    .glv-item:not(.glv-oos) .glv-card:hover .glv-img img {
        transform: scale(1.04);
    }
}
.glv-item .glv-card:focus-visible {
    outline: none;
}
.glv-item .glv-card:focus-visible .glv-img {
    outline: 2px solid #1d1d1f;
    outline-offset: 2px;
}
.glv-item .glv-card .price-box {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin: 0;
    padding: 0;
}
.glv-item .glv-card .price-box .price-label {
    display: none !important;
}
.glv-item .glv-card .price-box > span {
    margin: 0 !important;
}
.glv-item .glv-card .price-box .price {
    color: #1d1d1f !important;
    font-size: 20px !important;
    font-weight: 800 !important;
}
.glv-item .glv-card .price-box .old-price {
    order: 2;
}
.glv-item .glv-card .price-box .old-price .price {
    color: #6b6b70 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    text-decoration: line-through;
}
.glv-item .glv-monthly,
.glv-item .glv-stock {
    margin-top: 2px;
    color: #6b6b70;
    font-size: 13px;
}
.glv-item .glv-monthly .glv-over {
    white-space: nowrap;
}
.glv-item .glv-monthly strong {
    color: #1d1d1f;
    font-weight: 700;
}
/* months picker: the product page's dashed-underline dropdown */
.glv-item .glv-monthly .glv-term {
    -webkit-appearance: none;
    appearance: none;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0 12px 0 1px;
    border: 0;
    border-bottom: 1px dashed #c8c8cc;
    border-radius: 0;
    background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'><path d='M1 1l3 3 3-3' fill='none' stroke='%236b6b70' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 1px center;
    box-shadow: none;
    color: #1d1d1f;
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    cursor: pointer;
}
.glv-item .glv-monthly .glv-term:hover,
.glv-item .glv-monthly .glv-term:focus-visible {
    border-bottom-color: #1d1d1f;
    outline: none;
}

/* sold out: greyed-out tile, labels and price, "Out of stock online" instead of the monthly price */
.glv-item.glv-oos .glv-img {
    background: #f3f3f4;
}
.glv-item.glv-oos .glv-img img {
    opacity: .4 !important;
    filter: grayscale(1);
    mix-blend-mode: multiply;
}
.glv-item.glv-oos .glv-name,
.glv-item.glv-oos .glv-card .price-box .price {
    color: #6b6b70 !important;
}
.product-items .glv-item.glv-oos > .cdz-product-labels {
    opacity: .5;
    filter: grayscale(1);
}
.glv-item .glv-stock {
    font-weight: 600;
}
@media (max-width: 767px) {
    .glv-item .glv-name {
        margin-top: 8px;
        font-size: 13px;
    }
    .glv-item .glv-card .price-box .price {
        font-size: 17px !important;
    }
    .glv-item .glv-monthly,
    .glv-item .glv-stock {
        font-size: 12px;
    }
}
