/**
 * File: assets/css/ecomus-dynamic.css
 * Server path: /public_html/assets/css/ecomus-dynamic.css
 * Purpose: Small additions on top of the Ecomus theme CSS — toasts, sale price in cards,
 *          live search results, and auto-fit for admin-uploaded images of any size.
 */
.ecd-toasts { position: fixed; top: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.ecd-toast { background: #fff; border-left: 4px solid #28a745; box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 12px 36px 12px 14px; border-radius: 4px; font-size: 14px; position: relative; }
.ecd-toast.ecd-danger { border-color: #db1215; }
.ecd-toast.ecd-warning { border-color: #f0ad4e; }
.ecd-toast.ecd-info { border-color: #17a2b8; }
.ecd-x { position: absolute; right: 10px; top: 8px; cursor: pointer; font-size: 18px; line-height: 1; opacity: .6; }

.card-product-info .price .compare-at-price,
.tf-compare-item .price .compare-at-price { text-decoration: line-through; color: #8a8a8a; font-weight: 400; margin-right: 4px; }
.card-product-info .price .price-on-sale { color: #db1215; }

/* uploaded images keep the template slot size whatever their real size */
.card-product .product-img img, .tf-mini-cart-image img, .checkout-product-item img, .tf-compare-image img,
.collection-item img, .blog-article-item .article-thumb img, .demo-image img { object-fit: cover; }

.ecd-search-results { margin-top: 12px; max-height: 360px; overflow: auto; border: 1px solid #ebebeb; border-radius: 4px; }
.ecd-sr { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #f2f2f2; }
.ecd-sr img { width: 44px; height: 56px; object-fit: cover; border-radius: 3px; }
.ecd-sr span { flex: 1; }
.js-infinite { padding: 20px 0; }
.blog-content img { max-width: 100%; height: auto; }
/* keep the theme's original image slot ratio for any uploaded image size */
.ecd-fit { display: block; overflow: hidden; }
.ecd-fit > img, .card-product .product-img.ecd-fit img { width: 100%; height: 100%; object-fit: cover; }

/* ---- v1.1.0 display switches (Settings → Display & store mode) ---- */
.ecd-hide-price .card-product .price, .ecd-hide-price .tf-product-info-price, .ecd-hide-price .tf-qty-price,
.ecd-hide-price .lookbook-product .price, .ecd-hide-price .tf-price-wrap, .ecd-hide-price .tf-sticky-atc-variant-price { display: none !important; }
.ecd-hide-sizes .size-list, .ecd-hide-sizes .variant-picker-item.size-picker { display: none !important; }
.ecd-hide-colors .list-color-product { display: none !important; }
.ecd-hide-cart-buttons .quick-add, .ecd-hide-cart-buttons .btn-add-to-cart, .ecd-hide-cart-buttons .nav-cart,
.ecd-hide-cart-buttons .toolbar-item a[href="#shoppingCart"], .ecd-hide-cart-buttons .tf-sticky-btn-atc { display: none !important; }
.ecd-hide-wishlist .wishlist, .ecd-hide-wishlist .nav-wishlist, .ecd-hide-wishlist .tf-product-btn-wishlist:not(.compare) { display: none !important; }
.ecd-hide-compare .compare, .ecd-hide-compare .tf-product-btn-wishlist.compare { display: none !important; }
.ecd-hide-quickview .quickview { display: none !important; }
.ecd-hide-sale-badge .on-sale-wrap, .ecd-hide-sale-badge .badges-on-sale { display: none !important; }
.ecd-hide-currency .tf-currencies { display: none !important; }
.ecd-hide-language .tf-languages { display: none !important; }
/* catalog / website mode: hide everything shopping related */
.ecd-mode-catalog .nav-cart, .ecd-mode-website .nav-cart, .ecd-mode-website .nav-wishlist,
.ecd-mode-catalog .quick-add, .ecd-mode-website .quick-add, .ecd-mode-website .list-product-btn .wishlist, .ecd-mode-website .list-product-btn .compare,
.ecd-mode-catalog .toolbar-item a[href="#shoppingCart"], .ecd-mode-website .toolbar-item a[href="#shoppingCart"],
.ecd-mode-catalog .tf-mini-cart-threshold, .ecd-mode-website .tf-sticky-btn-atc, .ecd-mode-catalog .tf-sticky-btn-atc { display: none !important; }
.ecd-rtl { direction: rtl; text-align: right; }

/* ---- v1.2.0 ---- */
/* theme puts a red * after every checkout label – not on optional fields */
.form-checkout label.ecd-optional::after { content: none !important; }
/* red "-20%" sale badge on the top corner of the product image */
.ecd-sale-badge { position: absolute; top: 10px; left: 10px; z-index: 5; pointer-events: none; }
.ecd-sale-badge .on-sale-item, .on-sale-wrap .on-sale-item { background-color: #db1215 !important; color: #fff !important; font-weight: 600; border-radius: 3px; padding: 3px 8px; font-size: 12px; line-height: 18px; display: inline-block; }
.ecd-sale-badge-lg { top: 16px; left: 16px; }
.ecd-sale-badge-lg .on-sale-item { font-size: 14px; padding: 5px 12px; }
.ecd-cart-options .fieldset-radio label { cursor: pointer; }
.ecd-summary { font-size: 15px; }
.ecd-cart-options .fieldset-radio { display: flex; align-items: center; gap: 8px; }
.ecd-cart-options input[type=radio].tf-check { border-radius: 50%; flex-shrink: 0; }
.ecd-cart-options .fieldset-radio label { font-weight: 400; }
