/* ============================================
   AMAR SHOP — Custom Styles
   Estende pomme.css (fonti, header, footer).
   Palette: #f5f3e6 bg · #492622 text · #c3292f accento
   ============================================ */

/* --- Reset link default WC --- */
.amar-shop-page a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   HERO
   ============================================ */
.amar-shop-hero {
    padding: 180px 40px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.amar-shop-hero__label {
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(73, 38, 34, 0.5);
    display: block;
    margin-bottom: 32px;
}

.amar-shop-hero__title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: normal;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.15;
    color: #492622;
    margin: 0 0 32px 0;
    max-width: 800px;
}

.amar-shop-hero__text {
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.7;
    color: #492622;
    max-width: 600px;
    margin: 0;
}

/* ============================================
   FILTER BAR
   ============================================ */
.amar-shop-filters {
    padding: 24px 40px 32px;
    border-top: 1px solid rgba(73, 38, 34, 0.15);
    border-bottom: 1px solid rgba(73, 38, 34, 0.15);
    position: sticky;
    top: 0;
    background-color: #f5f3e6;
    z-index: 50;
}

.amar-shop-filters__inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 24px 40px;
    align-items: center;
    justify-content: space-between;
}

/* --- Tabs categorie --- */
.amar-shop-filters__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.amar-shop-filters__tab {
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(73, 38, 34, 0.55);
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.amar-shop-filters__tab:hover {
    color: #492622;
}

.amar-shop-filters__tab.is-active {
    color: #c3292f;
    border-bottom-color: #c3292f;
}

/* --- Form select --- */
.amar-shop-filters__form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 24px;
    align-items: center;
}

.amar-shop-filters__field {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
}

.amar-shop-filters__field-label {
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(73, 38, 34, 0.45);
}

.amar-shop-filters__field select {
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #492622;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(73, 38, 34, 0.25);
    padding: 4px 18px 4px 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23492622' stroke-width='1.2' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    transition: border-color 0.25s ease;
}

.amar-shop-filters__field select:focus {
    outline: none;
    border-bottom-color: #c3292f;
}

.amar-shop-filters__reset {
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #c3292f;
    align-self: flex-end;
    padding-bottom: 6px;
    transition: opacity 0.25s ease;
}

.amar-shop-filters__reset:hover {
    opacity: 0.6;
}

/* ============================================
   PRODUCT GRID
   ============================================ */
.amar-shop-products {
    padding: 80px 40px 120px;
    max-width: 1400px;
    margin: 0 auto;
}

.amar-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 56px 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.amar-shop-empty {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    color: rgba(73, 38, 34, 0.5);
    text-align: center;
    margin: 0;
    padding: 60px 0;
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.amar-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(12px);
    animation: amarFadeUp 0.6s ease forwards;
}

.amar-product-card:nth-child(2)  { animation-delay: 0.05s; }
.amar-product-card:nth-child(3)  { animation-delay: 0.1s;  }
.amar-product-card:nth-child(4)  { animation-delay: 0.15s; }
.amar-product-card:nth-child(5)  { animation-delay: 0.2s;  }
.amar-product-card:nth-child(6)  { animation-delay: 0.25s; }
.amar-product-card:nth-child(7)  { animation-delay: 0.3s;  }
.amar-product-card:nth-child(8)  { animation-delay: 0.35s; }

@keyframes amarFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.amar-product-card__link {
    display: block;
}

/* --- Media wrap --- */
.amar-product-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background-color: rgba(73, 38, 34, 0.04);
    margin-bottom: 16px;
}

.amar-product-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.5s ease, transform 0.8s ease;
}

.amar-product-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.amar-product-card__img--primary {
    opacity: 1;
    z-index: 1;
}

.amar-product-card__img--secondary {
    opacity: 0;
    z-index: 2;
}

.amar-product-card:hover .amar-product-card__img--primary {
    opacity: 0;
    transform: scale(1.02);
}

.amar-product-card:hover .amar-product-card__img--secondary {
    opacity: 1;
    transform: scale(1.02);
}

/* fallback senza seconda immagine: zoom leggero */
.amar-product-card:hover .amar-product-card__img--primary:only-child {
    opacity: 1;
    transform: scale(1.03);
}

/* --- Badge --- */
.amar-product-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 6px 10px;
    background-color: #f5f3e6;
    color: #492622;
}

.amar-product-card__badge--sale {
    color: #c3292f;
}

.amar-product-card__badge--new {
    color: #492622;
}

.amar-product-card__badge--soldout {
    background-color: #492622;
    color: #f5f3e6;
}

.amar-product-card.is-sold-out .amar-product-card__media {
    opacity: 0.55;
}

/* --- Info --- */
.amar-product-card__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 2px;
}

.amar-product-card__title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: normal;
    font-size: 15px;
    line-height: 1.3;
    color: #492622;
    margin: 0;
    transition: color 0.25s ease;
}

.amar-product-card:hover .amar-product-card__title {
    color: #c3292f;
}

.amar-product-card__price {
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: rgba(73, 38, 34, 0.75);
}

.amar-product-card__price del {
    color: rgba(73, 38, 34, 0.35);
    margin-right: 8px;
    font-weight: 400;
}

.amar-product-card__price ins {
    text-decoration: none;
    color: #c3292f;
}

/* --- CTA --- */
.amar-product-card__cta-wrap {
    margin-top: 14px;
    padding: 0 2px;
}

.amar-product-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c3292f;
    transition: opacity 0.25s ease, gap 0.25s ease;
}

.amar-product-card__cta:hover {
    opacity: 0.7;
    gap: 10px;
}

.amar-product-card__cta-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}

.amar-product-card__cta.added .amar-product-card__cta-arrow {
    transform: rotate(45deg);
}

.amar-product-card__cta.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* added_to_cart link che WC inietta dopo l'add */
.amar-product-card .added_to_cart {
    display: none;
}

/* ============================================
   PAGINATION
   ============================================ */
.amar-shop-pagination {
    margin-top: 80px;
    display: flex;
    justify-content: center;
}

.amar-shop-pagination .woocommerce-pagination ul {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.amar-shop-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-family: 'Public Sans', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #492622;
    border: 1px solid rgba(73, 38, 34, 0.15);
    transition: border-color 0.25s ease, color 0.25s ease;
}

.amar-shop-pagination .page-numbers:hover {
    border-color: #c3292f;
    color: #c3292f;
}

.amar-shop-pagination .page-numbers.current {
    border-color: #c3292f;
    color: #c3292f;
}

/* Single product layout lives in single-product.css */

/* ============================================
   CART / CHECKOUT / MY ACCOUNT — typography reset
   ============================================ */
.woocommerce-cart .pomme-main,
.woocommerce-checkout .pomme-main,
.woocommerce-account .pomme-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 180px 40px 120px;
}

.woocommerce-cart h1,
.woocommerce-checkout h1,
.woocommerce-account h1,
.woocommerce-cart .wc-block-cart__main-title,
.woocommerce-checkout .wc-block-checkout__main-title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: normal;
    font-size: clamp(2rem, 3.5vw, 3rem);
    color: #492622;
    margin: 0 0 40px 0;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    font-family: 'Public Sans', sans-serif;
    background-color: rgba(73, 38, 34, 0.04);
    border-top: 2px solid #c3292f;
    color: #492622;
    padding: 16px 20px;
    border-radius: 0;
    font-size: 14px;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    color: #c3292f;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .amar-products {
        grid-template-columns: repeat(3, 1fr);
        gap: 48px 24px;
    }
}

@media (max-width: 768px) {
    .amar-shop-hero {
        padding: 120px 16px 40px;
    }

    .amar-shop-filters {
        padding: 16px 16px 20px;
        position: relative;
        top: auto;
        overflow-x: hidden;
    }

    .amar-shop-filters__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        min-width: 0;
        max-width: 100%;
    }

    .amar-shop-filters__tabs {
        display: flex;
        flex-wrap: nowrap;
        gap: 18px;
        margin: 0 -16px;
        padding: 0 16px;
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .amar-shop-filters__tabs::-webkit-scrollbar {
        display: none;
    }

    .amar-shop-filters__tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .amar-shop-filters__form {
        gap: 16px 18px;
    }

    .amar-shop-products {
        padding: 48px 16px 80px;
    }

    .amar-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 16px;
    }

    .amar-product-card__title {
        font-size: 14px;
    }

    .amar-product-card__price {
        font-size: 13px;
    }

    .woocommerce-cart .pomme-main,
    .woocommerce-checkout .pomme-main,
    .woocommerce-account .pomme-main {
        padding: 120px 16px 80px;
    }
}

@media (max-width: 480px) {
    .amar-shop-hero__title {
        font-size: 1.8rem;
    }

    .amar-products {
        gap: 32px 12px;
    }
}
