/* =========================================================================
   MAC Makeup - Discontinued Products
   Front-end styles: category "cards" (Eye / Lip / Face / Other Products)
   and the resulting discontinued-item listing table.

   Palette is intentionally teal/charcoal so this page reads as its own
   section, distinct from the pink used on the lipstick & eyeshadow
   texture pages.
   ========================================================================= */

:root {
    --mdp-accent:        #0f7d8c;   /* teal - card title / links   */
    --mdp-accent-dark:   #0a5b66;   /* hover / current state        */
    --mdp-bg:            #eaf5f6;   /* card background              */
    --mdp-bg-hover:      #d9edef;   /* card hover background        */
    --mdp-border:        #c3e2e5;   /* card border                  */
    --mdp-text:          #33474b;   /* description text             */
}

/* ---------------------------------------------------------------------
   Per-category colors

   Each category (Eye / Lip / Face / Other Products) gets its own accent,
   background tint, and border, keyed off the "mdp-cat-<slug>" class that
   MDP_Frontend adds to both the category card and its subcategory pill
   row - so a category's card and its subcategory pills always match
   exactly. Anything not in this list (a future 5th category) simply
   falls back to the original teal defined above.
   --------------------------------------------------------------------- */

.mdp-cat-eye-products {
    --mdp-cat-accent:      #2f6fed;  /* blue        */
    --mdp-cat-accent-dark: #1c4fbb;
    --mdp-cat-bg:          #eaf1fd;
    --mdp-cat-bg-hover:    #d7e6fb;
    --mdp-cat-border:      #b9d3f7;
}

.mdp-cat-lip-products {
    --mdp-cat-accent:      #c2185b;  /* pink / berry */
    --mdp-cat-accent-dark: #8e0e40;
    --mdp-cat-bg:          #fbeaf1;
    --mdp-cat-bg-hover:    #f6d7e5;
    --mdp-cat-border:      #eeb9d0;
}

.mdp-cat-face-products {
    --mdp-cat-accent:      #d9770f;  /* amber / peach */
    --mdp-cat-accent-dark: #a35a0b;
    --mdp-cat-bg:          #fdf1e6;
    --mdp-cat-bg-hover:    #fbe6cf;
    --mdp-cat-border:      #f5cfa0;
}

.mdp-cat-other-products {
    --mdp-cat-accent:      #2e9e6b;  /* green / teal */
    --mdp-cat-accent-dark: #1f7350;
    --mdp-cat-bg:          #eafbf3;
    --mdp-cat-bg-hover:    #d3f5e4;
    --mdp-cat-border:      #a8e6c8;
}

/* ---------------------------------------------------------------------
   Category cards
   --------------------------------------------------------------------- */

.discontinued-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 10px 0 10px;
    padding: 0;
}

.mdp-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 220px;
    max-width: 260px;
    background: var(--mdp-cat-bg, var(--mdp-bg));
    border: 1px solid var(--mdp-cat-border, var(--mdp-border));
    border-radius: 8px;
    padding: 18px 20px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 125, 140, 0.08);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.mdp-card:hover,
.mdp-card:focus {
    background: var(--mdp-cat-bg-hover, var(--mdp-bg-hover));
    border-color: var(--mdp-cat-accent, var(--mdp-accent));
    transform: translateY(-6px);
    box-shadow: 0 10px 18px rgba(15, 125, 140, 0.18);
}

.mdp-card-current {
    background: var(--mdp-cat-bg-hover, var(--mdp-bg-hover));
    border-color: var(--mdp-cat-accent-dark, var(--mdp-accent-dark));
    box-shadow: 0 0 0 2px rgba(10, 91, 102, 0.15);
}

.mdp-card-title {
    display: block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--mdp-cat-accent, var(--mdp-accent));
    margin-bottom: 8px;
}

.mdp-card-count {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    opacity: 0.75;
    font-size: 0.75em;
}

.mdp-card-current .mdp-card-title {
    color: var(--mdp-cat-accent-dark, var(--mdp-accent-dark));
}

.mdp-card-desc {
    display: block;
    font-size: 13px;
    line-height: 1.45;
    color: var(--mdp-text);
}

br.clear {
    clear: both;
    display: block;
    height: 0;
    line-height: 0;
}

/* ---------------------------------------------------------------------
   Current category heading (shown above the listing once a card is
   clicked and the item table renders on the same page)
   --------------------------------------------------------------------- */

h3.current-texture {
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #d94f70;
    margin-bottom: 4px;
}

.mdp-category-header__count {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    opacity: 0.75;
    font-size: 0.7em;
}

.mdp-category-header__desc {
    color: var(--mdp-text);
    font-style: italic;
    margin: 0;
}

/* ---------------------------------------------------------------------
   Discontinued item listing table
   --------------------------------------------------------------------- */

.mdp-table-wrap {
    border: 1px solid var(--mdp-cat-border, var(--mdp-border));
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    margin-bottom: 16px;
}

table.macmakeupdiscontinueds {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-family: 'Roboto', sans-serif;
}

table.macmakeupdiscontinueds thead th {
    background: var(--mdp-cat-accent, var(--mdp-accent));
    color: #fff;
    text-align: left;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 10px 14px;
}

table.macmakeupdiscontinueds td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--mdp-cat-border, var(--mdp-border));
    font-size: 14px;
    color: var(--mdp-text);
}

table.macmakeupdiscontinueds tr:nth-child(even) td {
    background: var(--mdp-cat-bg, #f5fbfb);
}

/* ---------------------------------------------------------------------
   Small screens - stack the cards
   --------------------------------------------------------------------- */

@media (max-width: 600px) {
    .mdp-card {
        flex: 1 1 100%;
        max-width: none;
    }
}

/* ---------------------------------------------------------------------
   Subcategory pills (shown below the category cards on whichever
   category page is active - e.g. "Eye Liners", "Mascaras" under
   Eye Products)

   Styled as a raised button (moderate radius + bottom depth shadow)
   rather than a fully-rounded pill. The wrapping .discontinued-subcategories
   row carries the same "mdp-cat-<slug>" class as its category's card
   (see category_links()/subcategory_pills() in class-mdp-frontend.php),
   so --mdp-cat-accent etc. cascade down from the same per-category block
   above - each category's buttons always match its card's color exactly.
   --------------------------------------------------------------------- */

.discontinued-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
}

/* wordpress's wpautop tends to turn a blank line between shortcodes into
   an empty <p>&nbsp;</p> - this only fires on a paragraph that's a direct
   sibling of one of our own elements, so it can't affect unrelated
   paragraphs elsewhere on the site. */
.discontinued-categories + p:empty,
.discontinued-subcategories + p:empty,
.discontinued-categories + p:has(> br:only-child),
.discontinued-subcategories + p:has(> br:only-child) {
    display: none;
}

.mdp-subcat-pill {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
    background-color: var(--mdp-cat-accent, var(--mdp-accent));
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 45%);
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18), 0 4px 6px rgba(0, 0, 0, 0.12);
    transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.mdp-subcat-pill-count {
    font-weight: 400;
    opacity: 0.85;
}

.mdp-subcat-pill:hover,
.mdp-subcat-pill:focus {
    background-color: var(--mdp-cat-accent-dark, var(--mdp-accent-dark));
    transform: translateY(1px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18), 0 3px 5px rgba(0, 0, 0, 0.12);
    color: #fff;
    text-decoration: none;
}

.mdp-subcat-pill-current {
    background-color: var(--mdp-cat-accent-dark, var(--mdp-accent-dark));
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18), 0 0 0 2px #fff, 0 0 0 4px var(--mdp-cat-accent-dark, var(--mdp-accent-dark));
}

.mdp-subcat-pill-current::after {
    content: "\2713";
    margin-left: 6px;
}

/* ---------------------------------------------------------------------
   [discontinued-search] box

   Styled to match the search box used elsewhere on the site (the
   homepage's [eyeshadow-search] and the lipstick textures page's
   [mlt_search]) - same maroon button/border colors - rather than this
   plugin's own per-category palette, so the search UI itself stays
   visually consistent site-wide even though results below it are
   colored per their own category.
   --------------------------------------------------------------------- */

.mdp-search__form {
    display: flex;
    gap: 8px;
    width: 320px;
    max-width: 100%;
    margin: 0 0 20px;
    box-sizing: border-box;
}

.mdp-category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.mdp-category-header--search-only {
    justify-content: flex-end;
    margin-bottom: 16px;
}

.mdp-category-header__info {
    flex: 1 1 320px;
    min-width: 0;
}

.mdp-category-header__search {
    flex: 0 0 auto;
}

.mdp-category-header__search .mdp-search__form {
    margin: 0;
}

.mdp-search__form input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #e5d9d6;
    border-radius: 5px;
    font-size: 15px;
    color: #3a3a3a;
    box-sizing: border-box;
}

.mdp-search__form input[type="search"]:focus {
    outline: none;
    border-color: #b6746b;
}

.mdp-search__form button {
    padding: 8px 18px;
    border: none;
    border-radius: 5px;
    background: #7a4b45;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.12s ease-in-out;
}

.mdp-search__form button:hover {
    background: #b6746b;
}

.mdp-search__results {
    margin-top: 4px;
}

.mdp-empty {
    color: #7a4b45;
    font-size: 16px;
}
