Demas ajustes

This commit is contained in:
2026-10-09 23:02:05 -06:00
parent 220178d421
commit f9666c4088
83 changed files with 10271 additions and 6509 deletions
+17 -609
View File
@@ -119,610 +119,6 @@
</div>
</section>
{% stylesheet %}
.bestsellers {
padding: 50px 0;
color: #000;
background: #fff;
font-family: Archivo, sans-serif;
}
.bestsellers__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
margin-bottom: 20px;
padding: 0 100px;
}
.bestsellers__heading {
margin: 0;
color: #000;
font-family: "Roc Grotesk", Archivo, sans-serif;
font-size: 30px;
font-weight: 500;
line-height: normal;
text-transform: uppercase;
}
.bestsellers__tools {
display: flex;
flex-shrink: 0;
align-items: center;
gap: 10px;
}
.bestsellers__more {
padding: 0 10px;
color: #000;
font-size: 16px;
font-weight: 500;
line-height: normal;
text-decoration: none;
}
.bestsellers__arrows {
display: flex;
align-items: center;
gap: 20px;
}
.bestsellers__arrow {
display: grid;
width: 30px;
height: 30px;
place-items: center;
padding: 0;
border: 0;
border-radius: 60px;
background: #9dd6c7;
cursor: pointer;
}
.bestsellers__arrow:disabled {
cursor: default;
opacity: 0.35;
}
.bestsellers__arrow-icon {
display: block;
width: 20px;
height: 20px;
}
.bestsellers__arrow--prev .bestsellers__arrow-icon {
transform: rotate(-90deg);
}
.bestsellers__arrow--next .bestsellers__arrow-icon {
transform: rotate(90deg);
}
.bestsellers__body {
display: flex;
align-items: flex-start;
gap: 28px;
}
.bestsellers__promo {
position: relative;
display: block;
flex: 0 0 486px;
width: 486px;
height: 550px;
overflow: hidden;
border-radius: 0 10px 10px 0;
color: inherit;
text-decoration: none;
}
.bestsellers__promo-image {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.bestsellers__slider {
display: flex;
min-width: 0;
flex: 1 1 auto;
flex-direction: column;
align-self: stretch;
}
.bestsellers__progress {
position: relative;
height: 1px;
margin-top: auto;
background: #e6e6e6;
}
.bestsellers__progress-bar {
position: absolute;
top: 0;
left: 0;
height: 2px;
background: #000;
}
.bestsellers__viewport {
min-width: 0;
min-height: 493px;
flex: 1 1 auto;
overflow-x: auto;
scroll-snap-type: x mandatory;
scrollbar-width: none;
cursor: grab;
}
.bestsellers[data-feed]:not([data-sorted="true"]) .bestsellers__card {
visibility: hidden;
}
.bestsellers__viewport::-webkit-scrollbar {
display: none;
}
.bestsellers__viewport.is-dragging {
cursor: grabbing;
scroll-snap-type: none;
}
.bestsellers__track {
display: flex;
gap: 30px;
width: max-content;
padding-right: 100px;
}
.bestsellers__card {
display: flex;
flex: 0 0 386px;
flex-direction: column;
gap: 20px;
width: 386px;
scroll-snap-align: start;
}
.bestsellers__media {
position: relative;
width: 386px;
height: 386px;
overflow: hidden;
border-radius: 10px;
background: #fff;
}
.bestsellers__media-link {
position: absolute;
inset: 0;
display: block;
}
.bestsellers__image {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.bestsellers__image--hover {
position: absolute;
inset: 0;
opacity: 0;
transition: opacity 0.35s ease;
}
.bestsellers__media:hover .bestsellers__image--hover,
.bestsellers__media:focus-within .bestsellers__image--hover {
opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
.bestsellers__image--hover {
transition: none;
}
}
.bestsellers__image--empty {
background: #f3f3f3;
}
.bestsellers__badges {
position: absolute;
top: 10px;
left: 10px;
z-index: 1;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.bestsellers__badge {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 3px 5px;
border-radius: 2px;
color: #000;
font-size: 10px;
font-weight: 300;
line-height: normal;
text-transform: uppercase;
}
.bestsellers__badge--best {
background: #bfffb2;
}
.bestsellers__badge--skin {
background: #f7c585;
}
.bestsellers__wish {
position: absolute;
top: 20px;
right: 20px;
z-index: 1;
display: grid;
width: 25px;
height: 25px;
place-items: center;
padding: 0;
border: 0;
background: transparent;
cursor: pointer;
}
.bestsellers__wish-icon {
display: block;
width: 25px;
height: 25px;
}
.bestsellers__wish-icon svg {
display: block;
}
.bestsellers__wish.is-active svg path {
fill: #000;
}
.bestsellers__info {
display: flex;
flex-direction: column;
gap: 15px;
}
.bestsellers__copy {
display: flex;
flex-direction: column;
gap: 5px;
}
.bestsellers__title {
display: block;
overflow: hidden;
color: #000;
font-size: 18px;
font-weight: 700;
line-height: normal;
text-decoration: none;
text-overflow: ellipsis;
white-space: nowrap;
}
.bestsellers__subtitle,
.bestsellers__reviews,
.bestsellers__empty {
margin: 0;
}
.bestsellers__subtitle {
overflow: hidden;
color: #808181;
font-size: 14px;
font-weight: 300;
line-height: normal;
text-overflow: ellipsis;
white-space: nowrap;
}
.bestsellers__rating {
display: flex;
align-items: center;
gap: 10px;
}
.bestsellers__stars {
display: flex;
align-items: center;
gap: 1px;
}
.bestsellers__star {
display: block;
width: 10px;
height: 10px;
}
.bestsellers__star svg {
display: block;
}
.bestsellers__star.is-off {
opacity: 0.25;
}
.bestsellers__reviews {
color: #000;
font-size: 9px;
font-weight: 300;
line-height: normal;
white-space: nowrap;
}
.bestsellers__prices {
display: flex;
align-items: center;
gap: 32px;
}
.bestsellers__price,
.bestsellers__compare {
font-size: 16px;
line-height: normal;
}
.bestsellers__price {
font-weight: 700;
}
.bestsellers__compare {
color: #808181;
font-weight: 400;
text-decoration: line-through;
}
.bestsellers__actions {
position: absolute;
right: 20px;
bottom: 10px;
left: 20px;
z-index: 2;
display: flex;
gap: 10px;
margin: 0;
opacity: 0;
pointer-events: none;
transition: opacity 0.25s ease;
}
.bestsellers__media:hover .bestsellers__actions,
.bestsellers__media:focus-within .bestsellers__actions {
opacity: 1;
pointer-events: auto;
}
.bestsellers__bag,
.bestsellers__buy {
display: flex;
align-items: center;
justify-content: center;
height: 50px;
padding: 15px;
border: 0;
border-radius: 60px;
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
cursor: pointer;
}
.bestsellers__bag {
flex: 0 0 50px;
width: 50px;
background: #000;
}
.bestsellers__bag img {
display: block;
width: 25px;
height: 25px;
}
.bestsellers__buy {
flex: 1 1 auto;
background: #9dd6c7;
color: #000;
font-family: Archivo, sans-serif;
font-size: 16px;
font-weight: 300;
line-height: normal;
}
.bestsellers__bag:disabled,
.bestsellers__buy:disabled {
cursor: default;
opacity: 0.55;
}
.bestsellers__empty {
color: #000;
font-size: 14px;
font-weight: 400;
}
.bestsellers__more:focus-visible,
.bestsellers__bag:focus-visible,
.bestsellers__buy:focus-visible,
.bestsellers__arrow:focus-visible,
.bestsellers__wish:focus-visible,
.bestsellers__title:focus-visible,
.bestsellers__media-link:focus-visible,
.bestsellers__promo:focus-visible {
outline: 2px solid #000;
outline-offset: 2px;
}
@media (max-width: 1439px) {
.bestsellers__header {
padding-inline: 40px;
}
.bestsellers__track {
padding-right: 40px;
}
}
@media (max-width: 1024px) {
.bestsellers {
padding-top: 40px;
}
.bestsellers__header {
margin-bottom: 10px;
padding-inline: 15px;
}
.bestsellers__heading {
font-size: 20px;
}
.bestsellers__more {
padding: 0;
font-size: 14px;
}
.bestsellers__arrows {
display: none;
}
.bestsellers__body {
flex-direction: column;
gap: 20px;
}
.bestsellers__promo {
flex-basis: auto;
width: calc(100% - 30px);
height: 460px;
margin-inline: 15px;
border-radius: 10px;
}
.bestsellers__progress {
margin-top: 24px;
}
.bestsellers__viewport {
width: 100%;
min-height: 370px;
cursor: auto;
}
.bestsellers__track {
gap: 20px;
padding-right: 15px;
padding-left: 15px;
}
.bestsellers__card {
flex-basis: 245px;
gap: 10px;
width: 245px;
}
.bestsellers__media {
width: 245px;
height: 244px;
}
.bestsellers__badges {
top: 5px;
left: 5px;
}
.bestsellers__badge {
font-size: 7px;
}
.bestsellers__wish {
top: 10px;
right: 11px;
}
.bestsellers__info {
gap: 10px;
}
.bestsellers__title {
font-size: 14px;
}
.bestsellers__subtitle {
font-size: 10px;
}
.bestsellers__reviews {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
}
.bestsellers__rating {
position: relative;
}
.bestsellers__price,
.bestsellers__compare {
font-size: 14px;
}
.bestsellers__prices {
gap: 16px;
}
.bestsellers__actions {
right: 8px;
bottom: 8px;
left: 8px;
gap: 6px;
opacity: 1;
pointer-events: auto;
}
.bestsellers__bag,
.bestsellers__buy {
height: 36px;
padding: 0 8px;
}
.bestsellers__bag {
flex-basis: 36px;
width: 36px;
}
.bestsellers__bag img {
width: 18px;
height: 18px;
}
.bestsellers__buy {
font-size: 12px;
}
}
@media (prefers-reduced-motion: reduce) {
.bestsellers__viewport {
scroll-behavior: auto;
}
}
{% endstylesheet %}
{% javascript %}
(() => {
const wishlistKey = 'seasons-wishlist';
@@ -730,18 +126,23 @@
const readWishlist = () => {
try {
const stored = JSON.parse(window.localStorage.getItem(wishlistKey));
return Array.isArray(stored) ? stored.map(String) : [];
if (!Array.isArray(stored)) return [];
return stored.map((item) => {
if (item && typeof item === 'object') return { id: String(item.id || ''), handle: String(item.handle || '') };
return { id: String(item), handle: '' };
}).filter((item) => item.id);
} catch (error) {
return [];
}
};
const writeWishlist = (ids) => {
window.localStorage.setItem(wishlistKey, JSON.stringify(ids));
const writeWishlist = (items) => {
window.localStorage.setItem(wishlistKey, JSON.stringify(items));
document.dispatchEvent(new CustomEvent('seasons:wishlist'));
};
const applyWishlist = (root) => {
const saved = readWishlist();
const saved = readWishlist().map((item) => item.id);
root.querySelectorAll('[data-wishlist]').forEach((button) => {
const active = saved.includes(String(button.dataset.productId));
button.classList.toggle('is-active', active);
@@ -954,12 +355,19 @@
if (!root) return;
const id = String(wish.dataset.productId);
const handle = String(wish.dataset.productHandle || '');
const saved = readWishlist();
const next = saved.includes(id) ? saved.filter((item) => item !== id) : saved.concat(id);
const next = saved.some((item) => item.id === id)
? saved.filter((item) => item.id !== id)
: saved.concat({ id, handle });
writeWishlist(next);
applyWishlist(root);
});
document.addEventListener('seasons:wishlist', () => {
document.querySelectorAll('[data-bestsellers]').forEach((root) => applyWishlist(root));
});
document.addEventListener('submit', async (event) => {
const form = event.target;
if (!(form instanceof HTMLFormElement) || !form.classList.contains('bestsellers__form')) return;