/* PIYAMO v1.6.3.60 — readable rotating offers and compact, touch-friendly storefront.
   Layout-only additions. Existing WooCommerce/variable-cart handlers are unchanged. */

/* Offers: CSS grid reserves the height of the longest message so the 4s
   rotation never makes neighboring cards jump. No ellipses or hidden words. */
.product-card .piyamo-campaign-group--card,
body.single-product .piyamo-campaign-group--single {
    display: grid !important;
    grid-template-columns: minmax(0,1fr);
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    align-items: start;
    margin: 4px 0 0 !important;
    padding: 0 !important;
}
.product-card .piyamo-campaign-group .piyamo-promo-msg,
body.single-product .piyamo-campaign-group .piyamo-promo-msg {
    display: flex !important;
    grid-area: 1 / 1;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    word-break: normal;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    margin: 0 !important;
    line-height: 1.45 !important;
    font-size: 10px !important;
    animation: none !important;
}
.product-card .piyamo-campaign-group .piyamo-promo-msg.is-active,
body.single-product .piyamo-campaign-group .piyamo-promo-msg.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    animation: piyamo-offer-unclip .22s ease-out both !important;
}
.product-card .piyamo-campaign-group .piyamo-promo-msg__icon,
body.single-product .piyamo-campaign-group .piyamo-promo-msg__icon {
    flex: 0 0 12px;
    width: 12px;
    margin-top: 1px;
    font-size: 11px !important;
    line-height: 1.3;
}
.product-card .piyamo-campaign-group .piyamo-promo-msg__label,
body.single-product .piyamo-campaign-group .piyamo-promo-msg__label {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    line-height: inherit;
}
body.single-product .piyamo-campaign-group .piyamo-promo-msg {
    font-size: 12px !important;
}
@keyframes piyamo-offer-unclip {
    from { opacity: .5; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .product-card .piyamo-campaign-group .piyamo-promo-msg.is-active,
    body.single-product .piyamo-campaign-group .piyamo-promo-msg.is-active {
        animation: none !important;
    }
}

/* Streamlined product card hierarchy. Do not shrink the crucial price or name. */
.product-card .product-card-info,
body.woocommerce-shop .product-card .product-card-info,
body.post-type-archive-product .product-card .product-card-info,
body.tax-product_cat .product-card .product-card-info,
body.tax-product_tag .product-card .product-card-info {
    padding: 8px 10px 10px !important;
}
.product-card .product-card-name {
    margin: 2px 0 3px !important;
}
.product-card .piyamo-card-material-line {
    margin: 3px 0 2px !important;
}
.product-card .piyamo-card-pricing-extras {
    margin-top: 1px !important;
    gap: 3px !important;
}
.product-card .piyamo-card-pricing-extras .piyamo-auto-offer--loop {
    padding: 4px 7px !important;
    margin-bottom: 0 !important;
}
.product-card .piyamo-card-deal-row {
    row-gap: 3px;
}
.product-card .piyamo-card-gallery-toolbar {
    min-height: 38px;
    padding: 3px 7px !important;
}
.product-card .piyamo-card-gallery-toolbar .product-card-actions button,
.product-card .piyamo-card-gallery-toolbar .product-card-actions .product-card-wishlist {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    flex-basis: 34px !important;
}

/* Shop controls: reduce empty height, retain legible labels. */
.shop-filter-bar {
    margin-bottom: 14px !important;
    padding-block: 10px !important;
    gap: 9px !important;
}
.shop-page-header-grid,
.archive-page-header {
    margin-bottom: 12px !important;
}
.woocommerce ul.products,
.shop-main > ul.products {
    row-gap: 13px !important;
    column-gap: 12px !important;
}
/* Preserve horizontal image/details in list mode; grid styles remain separate. */
.shop-main.list-view .product-card,
.shop-main.list-view li.product.product-card {
    display: grid !important;
    grid-template-columns: minmax(150px, 28%) minmax(0,1fr) !important;
    align-items: stretch;
}
.shop-main.list-view .product-card .piyamo-card-visual {
    min-width: 0;
}
.shop-main.list-view .product-card .product-card-info {
    min-width: 0;
    padding: 12px 15px !important;
}
.shop-main.list-view .product-card .product-card-img-link {
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
}

/* Checkout, cart and account: calmer panels, without changing any forms. */
.woocommerce-cart-form,
.cart_totals,
.woocommerce-checkout-review-order,
.woocommerce-MyAccount-content,
.woocommerce-MyAccount-navigation {
    border-radius: 14px !important;
}
.woocommerce-checkout .piyamo-checkout-bank-offers {
    margin: 10px 0 !important;
    border-radius: 13px !important;
}

@media (max-width: 767px) {
    /* Compact two-column mobile cards; keep a comfortable bag control. */
    .woocommerce ul.products,
    .shop-main > ul.products {
        column-gap: 9px !important;
        row-gap: 11px !important;
    }
    .product-card .product-card-info,
    body.woocommerce-shop .product-card .product-card-info,
    body.post-type-archive-product .product-card .product-card-info,
    body.tax-product_cat .product-card .product-card-info,
    body.tax-product_tag .product-card .product-card-info {
        padding: 7px 8px 10px !important;
    }
    .product-card .product-card-name a {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
    .product-card .piyamo-card-material-tag {
        white-space: normal !important;
        text-overflow: clip !important;
        overflow: visible !important;
        overflow-wrap: anywhere;
        font-size: 9px !important;
        line-height: 1.35;
        padding: 3px 7px;
    }
    .product-card .piyamo-campaign-group .piyamo-promo-msg {
        font-size: 10px !important;
        line-height: 1.4 !important;
    }
    .product-card .piyamo-card-gallery-toolbar {
        min-height: 37px;
        padding: 2px 5px !important;
        gap: 3px;
    }
    .product-card .piyamo-card-gallery-toolbar .product-card-actions button,
    .product-card .piyamo-card-gallery-toolbar .product-card-actions .product-card-wishlist {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        flex-basis: 34px !important;
    }
    .product-card .piyamo-card-gallery-toolbar .piyamo-card-rating-pill {
        padding: 3px 5px;
        font-size: 10px;
    }
    /* Header/category stack: reduce decoration, not interaction target size. */
    body.piyamo-mobile-store-chrome .piyamo-mobile-category-filter,
    body.piyamo-mobile-shop-ui-active .piyamo-mobile-category-filter {
        padding: 5px 9px 6px !important;
        gap: 6px !important;
    }
    body.piyamo-mobile-store-chrome .piyamo-mobile-category-pill,
    body.piyamo-mobile-shop-ui-active .piyamo-mobile-category-pill {
        min-height: 38px !important;
        padding: 7px 12px !important;
        font-size: 11px !important;
    }
    body.piyamo-mobile-store-chrome .piyamo-mobile-notice-bar,
    body.piyamo-mobile-shop-ui-active .piyamo-mobile-notice-bar {
        min-height: 30px;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }
    .piyamo-sticky-header-shell .header-main-inner {
        margin-top: 4px !important;
        margin-bottom: 4px !important;
    }
    .shop-filter-bar {
        margin-bottom: 10px !important;
        padding-block: 7px !important;
    }
    /* The floating bag must not obscure so much of the collection. */
    body .piyamo-mobile-cart-dock {
        padding: 5px 8px !important;
        border-radius: 15px !important;
    }
    body .piyamo-mobile-cart-dock-inner {
        min-height: 48px !important;
        gap: 7px !important;
    }
    body .piyamo-mobile-cart-muse {
        width: 32px !important;
        height: 32px !important;
        flex-basis: 32px !important;
        border-radius: 10px !important;
    }
    body .piyamo-mobile-cart-button {
        min-height: 42px !important;
        padding: 0 11px !important;
        font-size: 10px !important;
    }
    body .piyamo-mobile-cart-copy strong {
        font-size: 11px !important;
    }
    .piyamo-global-scroll-top {
        bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    }
    /* Keep footer links and checkout controls clear of fixed overlays. */
    body:not(.woocommerce-cart):not(.woocommerce-checkout) .piyamo-mobile-footer-bottom {
        padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    }
    .shop-main.list-view .product-card,
    .shop-main.list-view li.product.product-card {
        grid-template-columns: minmax(105px, 35%) minmax(0,1fr) !important;
        gap: 0 !important;
    }
    .shop-main.list-view .product-card .product-card-info {
        padding: 8px 9px !important;
    }
}
@media (max-width: 360px) {
    .product-card .piyamo-card-gallery-toolbar .piyamo-card-rating-count {
        display: none !important;
    }
    .product-card .piyamo-card-deal-row { column-gap: 4px; }
    .shop-main.list-view .product-card,
    .shop-main.list-view li.product.product-card {
        grid-template-columns: 112px minmax(0,1fr) !important;
    }
}
