/* ==========================================================================
   Weekly Ad Plugin Styles
   ========================================================================== */

.weekly-ad {
    max-width: 100%;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.weekly-ad__nav > p {
    color: #000;
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.weekly-ad__nav-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.weekly-ad__nav-list li {
    margin: 7px 10px 7px 0;
}

.weekly-ad__nav-list a {
    color: #000;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.06);
    padding: 8px 18px;
    border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Section Heading
   -------------------------------------------------------------------------- */

.weekly-ad__section-heading {
    width: 100%;
    background: #5D893E;
    padding: 14px 20px;
    font-size: 1.4em;
    text-transform: uppercase;
    font-weight: 800;
    color: #fff;
    margin: 20px 0;
    border-radius: 14px;
    letter-spacing: 1px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Banner
   -------------------------------------------------------------------------- */

.weekly-ad__banner img {
    width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   Grid Layout (Featured + Products)
   -------------------------------------------------------------------------- */

.weekly-ad__grid {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

/* --------------------------------------------------------------------------
   Featured Column (33.3%)
   -------------------------------------------------------------------------- */

.weekly-ad__featured {
    flex: 1 1 33.33%;
    padding: 10px;
    box-sizing: border-box;
}

.weekly-ad__featured > img {
    background: transparent;
    padding: 10px;
    margin-bottom: 10px;
}

/* Featured image wrapper */
.weekly-ad__featured-image {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.weekly-ad__featured-image > img {
    padding: 20px;
    margin-bottom: 24px;
}

.weekly-ad__featured-image-img {
    aspect-ratio: 6 / 5;
    object-fit: contain;
    object-position: center;
}

/* Secondary featured images (thumbnails) */
.weekly-ad__featured-image-secondary {
    max-width: 60px !important;
    height: auto;
}

.weekly-ad__featured-thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Featured meta (thumbnails + text side by side) */
.weekly-ad__featured-meta {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
}

.weekly-ad__featured .weekly-ad__featured-meta:nth-of-type(4) {
    flex-direction: column;
    gap: 0;
}

/* Divider between primary and secondary featured items */
.weekly-ad__featured-divider {
    margin: 20px 0;
}

/* Secondary featured item */
.weekly-ad__featured-secondary {
    position: relative;
}

.weekly-ad__featured-secondary .weekly-ad__btn--featured {
    bottom: 0;
}

/* Featured column price is larger */
.weekly-ad__featured .weekly-ad__price {
    font-size: 36px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

a.weekly-ad__btn {
    border: 1px solid #AD1F23;
    background-color: #AD1F23;
    color: #fff;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

a.weekly-ad__btn:hover {
    background-color: #fff;
    color: #AD1F23;
    text-decoration: none;
}

.weekly-ad__btn--featured {
    position: absolute;
    right: 20px;
    bottom: 60px;
    z-index: 2;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   Products Column (66.67%)
   -------------------------------------------------------------------------- */

.weekly-ad__products {
    flex: 1 1 66.67%;
    padding: 10px;
    box-sizing: border-box;
}

.weekly-ad__products-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

/* --------------------------------------------------------------------------
   Product Item
   -------------------------------------------------------------------------- */

.weekly-ad__product {
    flex: 1 1 calc(50% - 40px);
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-width: 0 0 1px 0;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.2);
    margin: 10px;
}

.weekly-ad__product-inner {
    display: flex;
    flex-direction: row;
    border-bottom-width: 0;
}

.weekly-ad__product-logos {
    max-width: 45px;
}

.weekly-ad__product-details {
    position: relative;
}

.weekly-ad__product-details .weekly-ad__btn--featured {
    right: 0;
    bottom: 20px;
}

/* --------------------------------------------------------------------------
   Shared Typography
   -------------------------------------------------------------------------- */

.weekly-ad__subtitle {
    color: #1B1B1B;
    font-family: "Work Sans";
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    margin-bottom: 0;
}

.weekly-ad__title {
    font-family: "Work Sans";
    font-size: 20px;
    font-weight: 600;
    line-height: normal;
}

.weekly-ad__price {
    color: #AD1F23;
    font-family: "Work Sans";
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    display: inline-flex;
    align-items: flex-end;
    gap: 0.05em;
    line-height: 1;
    margin-bottom: 10px;
}

.weekly-ad__price sub,
.weekly-ad__price sup {
    font-size: 0.55em;
    line-height: calc(1em + 4px);
    top: auto;
}

.weekly-ad__description {
    margin: 6px 0;
    color: #1B1B1B;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media screen and (max-width: 768px) {
    .weekly-ad__grid {
        flex-direction: column;
    }

    .weekly-ad__featured,
    .weekly-ad__products {
        flex: 1 1 100%;
    }

    .weekly-ad__product {
        flex: 1 1 100%;
    }
}
