/* MageTime Apps widget styles: home sections and product widgets */

.home-page-content {
    --product-card-border-radius: 18px;
}

.home-page-content .home-hero-banner.home-hero-banner--carousel {
    max-width: none;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
    padding: 0;
    background: transparent;
}

.home-page-content .home-hero-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    line-height: 0;
    margin-bottom: 0;
}

.home-page-content .home-hero-slide {
    width: 100%;
}

.home-page-content .home-hero-slide-link {
    display: block;
    text-decoration: none;
    cursor: grab;
}

.home-page-content .home-hero-slide picture {
    display: block;
}

.home-page-content .home-hero-slide img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    -webkit-user-drag: none;
}

.home-page-content .home-hero-carousel.is-dragging,
.home-page-content .home-hero-carousel.is-dragging .home-hero-slide-link {
    cursor: grabbing;
}

/* Home hero: minimal prev/next + dots (arrows via ::before — avoids inline SVG conflicts) */
.home-page-content .home-hero-carousel .owl-nav {
    margin: 0;
    pointer-events: none;
}

.home-page-content .home-hero-carousel .owl-nav button.owl-prev,
.home-page-content .home-hero-carousel .owl-nav button.owl-next {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(17, 17, 17, .28) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: none;
    font-size: 0;
    line-height: 0;
    opacity: 0;
    transition: opacity .28s ease, background-color .28s ease, transform .28s ease;
    cursor: pointer;
}

.home-page-content .home-hero-carousel .owl-nav button.owl-prev {
    left: 16px;
}

.home-page-content .home-hero-carousel .owl-nav button.owl-next {
    right: 16px;
}

.home-page-content .home-hero-carousel .owl-nav button.owl-prev::before,
.home-page-content .home-hero-carousel .owl-nav button.owl-next::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
}

.home-page-content .home-hero-carousel .owl-nav button.owl-prev::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M15.5 4.5L8 12l7.5 7.5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.home-page-content .home-hero-carousel .owl-nav button.owl-next::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M8.5 4.5L16 12l-7.5 7.5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.home-page-content .home-hero-carousel:hover .owl-nav button.owl-prev,
.home-page-content .home-hero-carousel:hover .owl-nav button.owl-next,
.home-page-content .home-hero-carousel:focus-within .owl-nav button.owl-prev,
.home-page-content .home-hero-carousel:focus-within .owl-nav button.owl-next {
    opacity: 1;
}

.home-page-content .home-hero-carousel .owl-nav button.owl-prev:hover,
.home-page-content .home-hero-carousel .owl-nav button.owl-next:hover {
    background: rgba(17, 17, 17, .46) !important;
}

.home-page-content .home-hero-carousel .owl-nav button.owl-prev:active,
.home-page-content .home-hero-carousel .owl-nav button.owl-next:active {
    transform: translateY(-50%) scale(.96);
}

.home-page-content .home-hero-carousel .owl-nav button.owl-prev:focus-visible,
.home-page-content .home-hero-carousel .owl-nav button.owl-next:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .85);
    outline-offset: 2px;
    opacity: 1;
}

.home-page-content .home-hero-carousel .owl-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    z-index: 3;
    margin: 0;
    padding: 0;
    text-align: center;
    line-height: 0;
}

.home-page-content .home-hero-carousel .owl-dots .owl-dot {
    display: inline-block;
    margin: 0 4px;
    padding: 0;
    border: 0;
    background: transparent;
    vertical-align: middle;
    cursor: pointer;
}

.home-page-content .home-hero-carousel .owl-dots .owl-dot span {
    display: block;
    width: 7px;
    height: 7px;
    margin: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .55);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
    transition: width .28s ease, background-color .28s ease, opacity .28s ease;
}

.home-page-content .home-hero-carousel .owl-dots .owl-dot:hover span {
    background: rgba(255, 255, 255, .85);
}

.home-page-content .home-hero-carousel .owl-dots .owl-dot.active span {
    width: 22px;
    background: #fff;
}

.home-page-content .home-hero-carousel .owl-dots .owl-dot:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .85);
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .home-page-content .home-hero-carousel .owl-nav button.owl-prev,
    .home-page-content .home-hero-carousel .owl-nav button.owl-next {
        width: 34px;
        height: 34px;
        opacity: .72;
    }

    .home-page-content .home-hero-carousel .owl-nav button.owl-prev {
        left: 8px;
    }

    .home-page-content .home-hero-carousel .owl-nav button.owl-next {
        right: 8px;
    }

    .home-page-content .home-hero-carousel .owl-nav button.owl-prev::before,
    .home-page-content .home-hero-carousel .owl-nav button.owl-next::before {
        width: 16px;
        height: 16px;
        background-size: 16px 16px;
    }

    .home-page-content .home-hero-carousel .owl-dots {
        bottom: 10px;
    }

    .home-page-content .home-hero-carousel .owl-dots .owl-dot span {
        width: 6px;
        height: 6px;
    }

    .home-page-content .home-hero-carousel .owl-dots .owl-dot.active span {
        width: 18px;
    }
}

@media (hover: none) {
    .home-page-content .home-hero-carousel .owl-nav button.owl-prev,
    .home-page-content .home-hero-carousel .owl-nav button.owl-next {
        opacity: .7;
    }
}

.home-page-content .home-feature-list-inner {
    max-width: none;
}

.product-card-slider {
    position: relative;
}

.product-card-slider .product-card-slider-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 300px);
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px var(--product-component-content-inset, 24px) 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    user-select: none;
    overscroll-behavior-x: contain;
    scroll-behavior: auto;
}

.product-card-slider .product-card-slider-track::-webkit-scrollbar {
    display: none;
}

.product-card-slider .product-card-slider-track.is-dragging {
    cursor: grabbing;
}

.product-card-slider .product-card-slider-track.is-springing {
    transition: transform 0.32s cubic-bezier(0.33, 1, 0.68, 1);
    will-change: transform;
}

.product-card-slider .product-card-slider-track.is-dragging .product-card-slide {
    pointer-events: none;
    transition: none;
}

.product-card-slide {
    position: relative;
    border-radius: var(--product-card-border-radius, 18px);
    overflow: hidden;
    aspect-ratio: 3 / 4;
    min-height: 360px;
    box-shadow: 0 16px 32px -20px rgba(0, 0, 0, .32);
    transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    user-select: none;
    text-decoration: none;
    color: inherit;
}

.product-card-slider .product-card-slider-track:not(.is-dragging) .product-card-slide:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .4);
    z-index: 2;
}

.product-card-slide-media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.product-card-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .55s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
}

.product-card-slider .product-card-slider-track:not(.is-dragging) .product-card-slide:hover .product-card-slide-image {
    transform: scale(1.06);
}

.product-card-slide-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 20%,
        rgba(0, 0, 0, .10) 62%,
        rgba(0, 0, 0, .20) 100%
    );
    pointer-events: none;
}

.product-card-slide-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 16px 18px 20px;
    color: #fff;
    pointer-events: none;
}

.product-card-slide-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    min-height: calc(1.25em * 2);
    max-height: calc(1.25em * 2);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.product-card-slide .quote {
    font-size: 12px;
    opacity: .88;
    font-style: italic;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

body .products-grid {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

/* Desktop: 2-column page layout uses 3 product columns instead of 4 */
@media (min-width: 1025px) {
    body.page-layout-2columns-left .products-grid .product-items,
    body.page-layout-2columns-right .products-grid .product-items {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

body .products-grid .product-items {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

body .products-grid .product-item {
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    display: block;
    position: relative;
}

body .products-grid .product-item-info {
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e7e5e0;
    box-shadow: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    text-align: left;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    position: relative;
}

body .products-grid .product-item-info:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 38px -22px rgba(0, 0, 0, .28);
    border-color: #e9d9c9;
}

body .products-grid .product-item-photo {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    text-decoration: none;
    margin: 0;
    min-height: 0;
    padding: 0;
    background: #f8f8f8;
    border-bottom: 1px solid #f0ece6;
    box-shadow: none;
}

body .products-grid .product-item-photo:hover,
body .products-grid .product-item-info:hover .product-item-photo {
    box-shadow: none;
}

body .products-grid .product-item-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
    background:
        linear-gradient(to top, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.03) 30%, transparent 48%),
        linear-gradient(to top, rgba(0,0,0,0.06) 0%, transparent 20%);
}

body .products-grid .product-item-info:hover .product-item-photo::after {
    opacity: 1;
}

body .products-grid .product-image-container,
body .products-grid .product-image-wrapper {
    display: block;
    width: 100%;
    height: 100%;
}

body .products-grid .product-image-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    position: unset;
    top: unset;
    left: unset;
    right: unset;
    bottom: unset;
    transition: transform .5s ease;
}

body .products-grid .product-item-info:hover .product-image-photo {
    transform: scale(1.05);
}

body .products-grid .product-item-details {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    position: static;
    text-align: left;
    opacity: 1;
    visibility: visible;
}

body .products-grid .product-series {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ff3d2e;
}

body .products-grid .product-meta {
    font-size: 11px;
    color: #7a7a7a;
    line-height: 1.4;
}

body .products-grid .product-item-name {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    min-height: calc(1.35em * 2);
    height: calc(1.35em * 2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    text-overflow: clip;
}

body .products-grid .product-item-name .product-item-link {
    color: #111111;
    text-decoration: none;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    margin: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

body .products-grid .product-item-name .product-item-link:hover {
    color: #ff6a1a;
}

/* Cart page product names – fixed 2-line height */
body .cart.table-wrapper .product-item-name,
body #shopping-cart-table .product-item-name {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    min-height: calc(1.35em * 2);
    max-height: calc(1.35em * 2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

body .cart.table-wrapper .product-item-name > a,
body #shopping-cart-table .product-item-name > a {
    color: inherit;
    text-decoration: none;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    white-space: normal;
}

body .products-grid .price-box.price-final_price {
    margin: 4px 0 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

body .products-grid .price-box.price-final_price .price {
    font-weight: 800;
    font-size: 16px;
    color: #111111;
}

body .products-grid .price-box .special-price {
    order: -1;
}

body .products-grid .price-box .special-price .price-label {
    display: none;
}

body .products-grid .price-box .old-price {
    order: 1;
}

body .products-grid .price-box .old-price .price-label {
    display: none;
}

body .products-grid .price-box .old-price .price {
    font-weight: 400;
    font-size: 13px;
    color: #999999;
    text-decoration: line-through;
}

body .products-grid .stock {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

body .products-grid .stock::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2bb673;
    box-shadow: 0 0 0 3px rgba(43, 182, 115, .18);
    flex: 0 0 7px;
}

body .products-grid .stock.available {
    color: #2b7a52;
}

body .products-grid .stock.low {
    color: #c9621a;
}

body .products-grid .stock.low::before {
    background: #e8a045;
    box-shadow: 0 0 0 3px rgba(232, 160, 69, .2);
}

body .products-grid .stock.unavailable {
    color: #c33;
}

body .products-grid .stock.unavailable::before {
    background: #c33;
    box-shadow: 0 0 0 3px rgba(204, 51, 51, .18);
}

body .products-grid .product-stock-bar {
    height: 3px;
    border-radius: 4px;
    background: #f0ebe3;
    overflow: hidden;
    margin-top: 1px;
}

body .products-grid .product-stock-bar > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2bb673, #6ed29c);
    border-radius: 4px;
}

body .products-grid .stock.low + .product-stock-bar > i {
    background: linear-gradient(90deg, #e8a045, #f4c27a);
}

body .products-grid .stock.unavailable + .product-stock-bar > i {
    background: linear-gradient(90deg, #c33, #e27c7c);
}

body .products-grid .product-item-inner {
    margin-top: auto;
    padding-top: 12px;
    width: 100%;
    display: block;
    opacity: 1;
    visibility: visible;
}

body .products-grid .product-item-actions {
    margin-top: auto;
    margin-bottom: 0;
    white-space: normal;
    font-size: inherit;
    display: block;
    width: 100%;
}

body .products-grid .product-item-actions > .actions-primary {
    display: block;
    width: 100%;
    float: none;
    max-width: none;
    opacity: 1;
    visibility: visible;
}

body .products-grid .actions-primary > form[data-role="tocart-form"] {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

body .products-grid .actions-primary .action.tocart {
    width: 100%;
}

body .products-grid .qty-box {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #e7e5e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    min-width: 94px;
}

body .products-grid .qty-box .qtyminus,
body .products-grid .qty-box .qtyplus {
    width: 30px;
    min-width: 30px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111111;
    background: transparent;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    border: 0;
}

body .products-grid .qty-box .qtyminus:hover,
body .products-grid .qty-box .qtyplus:hover {
    background: #faf6f1;
    color: #ff6a1a;
}

body .products-grid .qty-box .qty {
    width: 32px;
    min-width: 32px;
    height: 40px;
    border: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #111111;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin: 0;
}

body .products-grid .action.tocart.primary {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 10px;
    background: #232833;
    border: 0;
    color: #fff;
    padding: 0 14px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1;
}

body .products-grid .action.tocart.primary::before {
    display: none;
}

body .products-grid .action.tocart.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -10px rgba(35, 40, 51, .45);
    background: #1a1f28;
}

body .products-grid .action.tocart.primary[disabled],
body .products-grid .action.tocart.primary.disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

/* Override Porto column-width rules — use deeper DOM chain for higher specificity */
body .products-grid .product-items .product-item {
    width: auto;
    clear: none;
}

body .products-grid .product-items .product-item.nth-child-2np1,
body .products-grid .product-items .product-item.nth-child-3np1,
body .products-grid .product-items .product-item.nth-child-5np1 {
    clear: none;
}

/* Button text: full "Add to Cart" on wider screens, short "Buy" on narrow */
body .products-grid .cart-label-full {
    display: inline;
}

body .products-grid .cart-label-short {
    display: none;
}

@media (max-width: 1199px) {
    body .products-grid .cart-label-full {
        display: none;
    }

    body .products-grid .cart-label-short {
        display: inline;
    }
}

@media (max-width: 1024px) {
    .product-card-slider .product-card-slider-track {
        grid-auto-columns: minmax(260px, 280px);
    }

    body .products-grid .product-items {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    body .page-main, body.catalog-category-view .page-main {
        padding-left: 10px;
        padding-right: 10px;
    }

    .product-card-slider .product-card-slider-track {
        grid-auto-columns: 78%;
        gap: 16px;
    }

    .product-card-slide {
        min-height: 320px;
    }

    body .products-grid .product-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    body .products-grid .product-item-details {
        padding: 14px 14px 16px;
    }

    body .products-grid .product-item-name {
        font-size: 13px;
    }

    body .products-grid .price-box.price-final_price .price {
        font-size: 15px;
    }

    body .products-grid .price-box .old-price .price {
        font-size: 12px;
    }

    body .products-grid .action.tocart.primary {
        font-size: 13px;
        min-height: 38px;
        padding: 0 10px;
    }

    body .products-grid .qty-box .qtyminus,
    body .products-grid .qty-box .qtyplus {
        width: 28px;
        min-width: 28px;
        height: 38px;
    }

    body .products-grid .qty-box .qty {
        width: 28px;
        min-width: 28px;
        height: 38px;
    }
}

@media (max-width: 400px) {
    .product-card-slider .product-card-slider-track {
        grid-auto-columns: 84%;
    }

    .product-card-slide-title {
        font-size: 16px;
    }

    body .products-grid .product-items {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    body .products-grid .product-item-details {
        padding: 12px 12px 14px;
    }
}
