/**
 * Sale visuals that appear site-wide (every PLP, AJAX results, the drones and
 * enterprise pages, product pages, the header menu):
 *  - the sale ribbon [ SALE | -13% ] on product photos (sale-ribbon.php)
 *  - the Black Friday strip above the price on product pages
 *  - the red sale price
 *  - the highlighted "מבצעים" menu link
 *
 * #C82333 instead of the old #dc3545: 5.6:1 on white (was 4.53:1).
 *
 * @package Mesa
 * @since 2.9.0
 */

:root {
    --mesa-sale-red: #C82333;
}

/* --------------------------------------------------------------------------
   Ribbon: black label (lime italic, brand) + red value, parallelogram cuts.
   In RTL the label sits at the outer (right) edge, the value next to it.
   -------------------------------------------------------------------------- */
.mesa-sale-ribbon {
    display: inline-flex;
    align-items: stretch;
    direction: rtl;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(8, 5, 12, 0.28));
    pointer-events: none;
    white-space: nowrap;
}

.mesa-sale-ribbon__label,
.mesa-sale-ribbon__value {
    display: inline-flex;
    align-items: center;
    font-family: 'Open Sans', sans-serif;
    font-weight: 800;
    font-style: italic;
}

.mesa-sale-ribbon__label {
    background: var(--mesa-black, #08050C);
    color: var(--mesa-lime, #CEFE65);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    clip-path: polygon(9px 0, 100% 0, 100% 100%, 0 100%);
}

.mesa-sale-ribbon__value {
    background: var(--mesa-sale-red);
    color: var(--mesa-white, #FFFFFF);
    margin-inline-start: -5px;
    clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}

/* Label alone (no sale price / percent switched off): full parallelogram */
.mesa-sale-ribbon__label:only-child {
    clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}

/* Card size */
.mesa-sale-ribbon--card .mesa-sale-ribbon__label {
    font-size: 12px;
    padding: 6px 10px 6px 14px;
}

.mesa-sale-ribbon--card .mesa-sale-ribbon__value {
    font-size: 13px;
    padding: 6px 14px 6px 14px;
}

.mesa-sale-ribbon--card .mesa-sale-ribbon__label:only-child {
    padding: 6px 14px;
}

/* The card's badge column sits top-right of the photo; nudge to the edge. */
.mesa-product-card__badges .mesa-sale-ribbon {
    margin-inline-end: -8px;
}

/* Product page size: overlay in the gallery's single grid cell */
.mesa-sale-ribbon--product {
    grid-area: 1 / 1;
    align-self: start;
    justify-self: start;
    z-index: 2;
    margin: 14px 0 0;
}

.mesa-sale-ribbon--product .mesa-sale-ribbon__label {
    font-size: 15px;
    padding: 9px 14px 9px 20px;
}

.mesa-sale-ribbon--product .mesa-sale-ribbon__value {
    font-size: 17px;
    padding: 9px 18px;
}

.mesa-sale-ribbon--product .mesa-sale-ribbon__label:only-child {
    padding: 9px 20px;
}

/* Sale prices in red: cards and product page */
.mesa-product-card__price ins {
    color: var(--mesa-sale-red);
}

.mesa-product-price .mesa-price-custom__sale .woocommerce-Price-amount {
    color: var(--mesa-sale-red) !important;
}

/* --------------------------------------------------------------------------
   Product page: Black Friday strip above the price
   -------------------------------------------------------------------------- */
.mesa-sale-strip {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 6px 0 12px;
    padding: 10px 14px 10px 64px;
    background:
        linear-gradient(115deg, transparent 0 3%, var(--mesa-lime, #CEFE65) 3% 7%, transparent 7% 9%, rgba(206, 254, 101, 0.45) 9% 10.5%, transparent 10.5%),
        var(--mesa-black, #08050C);
    color: var(--mesa-white, #FFFFFF);
    direction: rtl;
}

.mesa-sale-strip__eyebrow {
    display: inline-block;
    padding: 4px 14px;
    background: var(--mesa-lime, #CEFE65);
    color: var(--mesa-black, #08050C);
    font-family: 'Open Sans', sans-serif;
    font-weight: 800;
    font-style: italic;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    text-transform: uppercase;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.mesa-sale-strip__text {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.mesa-sale-strip__link,
.mesa-sale-strip__link:visited {
    margin-inline-start: auto;
    color: var(--mesa-lime, #CEFE65);
    font-size: 14px;
    font-weight: 700;
    font-style: italic;
    text-decoration: none;
    white-space: nowrap;
}

.mesa-sale-strip__link:hover {
    color: var(--mesa-white, #FFFFFF);
    text-decoration: none;
}

.mesa-sale-strip__link:focus-visible {
    outline: 2px solid var(--mesa-lime, #CEFE65);
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .mesa-sale-ribbon--card .mesa-sale-ribbon__label { font-size: 11px; padding: 5px 8px 5px 12px; }
    .mesa-sale-ribbon--card .mesa-sale-ribbon__value { font-size: 12px; padding: 5px 12px; }
    .mesa-sale-ribbon--card .mesa-sale-ribbon__label:only-child { padding: 5px 12px; }
    .mesa-sale-strip { padding-left: 44px; }
    .mesa-sale-strip__link { margin-inline-start: 0; }
}

/* --------------------------------------------------------------------------
   Header menu: the link to the sale page (class added automatically in
   inc/wc-sale-page.php for any menu item pointing at the sale category).
   -------------------------------------------------------------------------- */
#mesa-header .mesa-header__menu > li.mesa-menu-item--sale > a,
.mesa-header__menu > li.mesa-menu-item--sale > a {
    color: var(--mesa-lime, #CEFE65) !important;
    font-weight: 700 !important;
    font-style: italic;
}

#mesa-header .mesa-header__menu > li.mesa-menu-item--sale > a:hover {
    color: var(--mesa-white, #FFFFFF) !important;
}

.mesa-mobile-menu__list li.mesa-menu-item--sale > a {
    font-weight: 700 !important;
    font-style: italic;
}
