/*
    MerchStudio version 0.01 - Core CSS File
    Copyright (c) 2025 Michael Lewis White and MerchStudio Inc.
    Client Side CSS for MerchStudio App
    @version client/css/client.css - 0.01 - 05-14-2025 - totaltec
    @version client/css/client.css - 0.02 - 11-10-2026 - merchstudio (MERCH_MOB5: header phone and footer on phones)
    @version client/css/client.css - 0.03 - 11-10-2026 - merchstudio (MERCH_MOB9: receipt and order status on phones)
    @version client/css/client.css - 0.04 - 11-20-2026 - merchstudio (MERCH_MSC1: Saved Cards in My Account)
    @version client/css/client.css - 0.05 - 11-20-2026 - merchstudio (MERCH_MSC2: readable Saved Cards rows, Default tag, Make default and trash buttons)
    @version client/css/client.css - 0.06 - 11-26-2026 - merchstudio (MERCH_BSG5: Save To Projects and Save to user buttons on the builders)
    @version client/css/client.css - 0.07 - 11-26-2026 - merchstudio (MERCH_BSG6: Leave this page window buttons)

    # included by client/css_load.tpl
*/

/**
 * Header Section
 */
#logo_row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#logo_wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/*
=========================================
Header Tools (Shared Structure)
=========================================
*/
.header_tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.head_action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    color: inherit;
}

.head_icon_wrap {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    position: relative;
}

.head_action .merch_icon {
    width: 35px;
    height: 35px;
}

.head_label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1;
}

/* User Dropdown Specifics */
.drop_user {
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}

.drop_name {
    font-weight: 600;
    font-size: 0.9rem;
}

.drop_email {
    font-size: 0.75rem;
    color: var(--middle_grey); }

/* Remove default link styling for the logo area */
a.logo_link,
a.logo_link:link,
a.logo_link:visited,
a.logo_link:active,
a.logo_link:focus {
    text-decoration: none;
    color: inherit;
}

#logo {
    display: inline-block;
    margin: 5px 5px 0 0;
    padding: 3px;
    width: auto;
    height: 90px;
    vertical-align: middle;
}

#logo > svg,
#logo > img {
    display: block;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.phone {
    margin: 0 15px;
    align-self: center;
    white-space: nowrap;
}

/* Control link styling for login and phone links */
#login_link,
#login_link:link,
#login_link:visited,
.phone a,
.phone a:link,
.phone a:visited {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

#login_link:hover,
#login_link:focus,
.phone a:hover,
.phone a:focus {
    color: var(--link_hover);
    text-decoration: underline;
}

#header_user_column {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.drop_trigger {
    transition: all 0.2s ease-out;
}

.drop_trigger:hover {
    background-color: var(--hover);
    border-color: var(--highlight);
}



/*
=========================================
Footer Links (from Nexus Menu)
=========================================
*/

/* Container for the footer links navigation within #merch_footer */
#merch_footer .footer_links {
    text-align: center; /* Center the list of links */
    padding: 10px 0;
    /* Optional: a subtle line above these links */
    border-top: 1px solid var(--base);
    margin-top: 10px;
}

#merch_footer .footer_links ul {
    list-style-type: none; /* Remove default bullets */
    padding: 0;
    margin: 0;
    display: inline-block; /* Allows centering via parent's text-align */
}

#merch_footer .footer_links li {
    display: inline-block; /* Arrange links horizontally */
    margin: 0 10px;       /* Spacing between link items */
}

/* Styling for the actual anchor tags in the footer links menu */
#merch_footer .footer_links a,
#merch_footer .footer_links a:visited {
    color: var(--text); /* Using theme's base text color for subtlety */
    text-decoration: none;
    font-size: 0.9em;    /* Slightly smaller than main footer text */
    padding: 3px 0;      /* Small vertical padding for click area */
}

#merch_footer .footer_links a:hover,
#merch_footer .footer_links a:focus {
    color: var(--link_hover); /* Use theme's link hover color */
    text-decoration: underline;
}

/* Styling for the existing bottom row of the footer */
#merch_footer .footer_bottom {
    text-align: center;
    padding: 10px 0 15px 0; /* Ensure enough padding at the very bottom */
    font-size: 0.85em;     /* Keep this text small */
}

#merch_footer .footer_bottom .powered_by,
#merch_footer .footer_bottom .copyright {
    display: inline;
    margin: 0 5px; /* Space if they are side-by-side or wrap */
}

/* --- Sub-Path Navigation (Node Kids) --- */
.sub_path_nav {
    margin-top: 30px;    /* Space above this navigation block */
    margin-bottom: 30px; /* Space below this navigation block */
    padding-bottom: 20px;
    border-bottom: 1px solid var(--base);
}

.sub_path_nav.bottom {
    padding-top: 20px;
    border-top: 1px solid var(--base);
}

.sub_path_list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: grid;
    /* Creates responsive columns: each takes 1fr of space,
       but won't shrink below 180px, and will wrap. */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px; /* Spacing between the navigation items */
}

.sub_path_item a,
.sub_path_item a:link,
.sub_path_item a:visited {
    display: block; /* Makes the entire area clickable */
    text-decoration: none;
    color: var(--text);
    padding: 15px;
    border-radius: 6px;
    background-color: transparent;
    transition: background-color 0.2s ease-in-out,
                transform 0.2s ease-in-out;
    text-align: center; /* Centers the image and text below it */
}

.sub_path_item a:hover,
.sub_path_item a:focus {
    background-color: var(--base);
    color: var(--link_hover);
    transform: translateY(-2px); /* Subtle lift effect */
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); /* Subtle shadow */
}

.sub_path_item svg,
.sub_path_image {
    display: block;
    width: 160px;
    height: 160px;
    object-fit: cover;
    margin: 0 auto 10px auto;
    border-radius: 4px;
    border: 1px solid var(--line); /* Subtle border */
}

.sub_path_name {
    display: block;
    font-size: 1em;
    font-weight: 500;
    line-height: 1.3;
}

/* --- My Designs Gallery Modal --- */

.design_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.design_row {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius, 4px);
    background-color: var(--bg-panel);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Hover state for the whole row so it feels clickable */
.design_row:hover {
    background-color: var(--bg-hover, rgba(0,0,0,0.02));
    border-color: var(--accent);
}

.design_thumbnail {
    width: 80px;
    height: 80px;
    flex-shrink: 0; /* Prevents the thumbnail from squishing on small screens */
    background: rgba(0,0,0,0.03);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 4px;
}

.design_thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.empty_thumb {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.empty_thumb svg {
    width: 40px;
    height: 40px;
    opacity: 0.3;
}

.design_details {
    flex-grow: 1; /* Pushes the delete button all the way to the right */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.design_name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1rem;
    color: var(--text-main);
}

.design_size {
    font-size: 0.85rem;
}

/* Specific styling for the delete icon so it doesn't look like a standard heavy button */
.btn_delete_design {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Danger color exclusively on hover */
.btn_delete_design:hover {
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

.no_designs_msg {
    padding: 20px;
    text-align: center;
    font-style: italic;
}


/* Mobile Size */
@media (max-width: 800px) {
    .phone {
        margin: 5px 0 0 0;
        font-size: 0.8em;
    }
}
/* MERCH_SUP7: My Designs project cards (MERCH_SUP10: categories, artwork, order stats) */
.project_section {
    margin-bottom: 20px;
}
.project_head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 14px;
}
.project_section_title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.1em;
}
.project_total,
.project_cat_count,
.project_filter_count {
    display: inline-block;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    color: var(--text);
}
.project_filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.project_filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9em;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.project_filter:hover {
    border-color: var(--highlight);
}
.project_filter.is_active {
    border-color: var(--highlight);
    background-color: color-mix(in srgb, var(--highlight) 16%, transparent);
    font-weight: 600;
}
.project_cat {
    margin-bottom: 22px;
}
.project_cat[hidden] {
    display: none;
}
.project_cat_title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--middle_grey);
}
.project_cat_note {
    margin: -4px 0 10px;
    font-size: 0.9em;
}
.project_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.project_card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background-color: var(--base);
    overflow: hidden;
    transition: border-color 0.15s, transform 0.15s;
}
.project_card:hover {
    border-color: var(--highlight);
}
.project_media {
    position: relative;
    height: 160px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    gap: 2px;
    background-color: var(--hover);
    background-image:
        linear-gradient(45deg, rgba(128,128,128,0.12) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(128,128,128,0.12) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(128,128,128,0.12) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(128,128,128,0.12) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border-bottom: 1px solid var(--line);
}
.project_media.art_2 {
    grid-template-columns: 1fr 1fr;
}
.project_media.art_3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.project_media.art_3 .project_art:first-child {
    grid-row: span 2;
}
.project_media.art_4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}
.project_art {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 6px;
    overflow: hidden;
}
.project_art img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.project_art_empty svg {
    width: 40px;
    height: 40px;
    opacity: 0.3;
}
.project_art.is_broken::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 2px dashed var(--line);
    border-radius: 6px;
}
.project_art.is_broken img {
    display: none;
}
.project_more {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: 0.75em;
    font-weight: 700;
}
.project_badges {
    position: absolute;
    left: 8px;
    top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.project_badges:empty {
    display: none;
}
.project_badge {
    font-size: 0.72em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background-color: var(--bg);
    color: var(--text);
}
.project_team {
    border-color: var(--accent);
}
.project_body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px 4px;
    min-width: 0;
}
.project_name_row {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.project_name {
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project_name_input {
    flex: 1 1 auto;
    min-width: 0;
}
.project_specs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    font-size: 0.85em;
    color: var(--middle_grey);
}
.project_specs span + span::before {
    content: '\00B7';
    margin: 0 6px;
}
.project_stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 10px;
    padding: 6px 8px;
    border-radius: 6px;
    background-color: var(--bg);
    font-size: 0.85em;
}
.project_icon_btn {
    background: none;
    border: 0;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    color: inherit;
    line-height: 0;
}
.project_icon_btn:hover {
    background-color: var(--hover);
}
.project_actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px 12px;
    margin-top: auto;
}
.project_actions .btn_project_cart {
    flex: 1 1 auto;
}
.project_actions .btn_project_delete {
    margin-left: auto;
}
.project_actions .btn_project_delete:hover {
    color: var(--accent_red);
}
.project_drafts .design_list {
    margin-top: 4px;
}
@media (max-width: 520px) {
    .project_grid {
        grid-template-columns: 1fr;
    }
    .project_media {
        height: 140px;
    }
}

/* MERCH_MOB5: phones. Header phone number and footer links big enough to tap and text big enough
   to read; copyright and Powered by on their own lines. */
@media (max-width: 767.98px) {
    /* The phone number in the header: readable and tappable. */
    .phone {
        font-size: 13px;
    }
    .phone a {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
    }
    #merch_footer .footer_links li {
        display: block;
        margin: 0;
    }
    #merch_footer .footer_links li a,
    #merch_footer .footer_links li a:visited {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 12px;
        font-size: 15px;
    }
    #merch_footer .footer_bottom {
        font-size: 13px;
    }
    #merch_footer .footer_bottom .copyright,
    #merch_footer .footer_bottom .powered_by {
        display: block;
        margin: 4px 0;
    }
    #merch_footer .footer_bottom .powered_by a {
        display: inline-flex;
        align-items: center;
        min-height: 32px;
    }
}

/* MERCH_MOB9: phones. The receipt (success page and View Receipt) ran 111px
   past the right edge: the shop name and the order details now stack, and the
   padding is smaller. Order status badges at 12px. Selectors are two classes
   deep because receipt.css and success.css load after this file. */
@media (max-width: 767.98px) {
    .success_container.container {
        padding: 20px 12px;
    }
    .success_container .merch_receipt {
        padding: 20px 16px;
    }
    .merch_receipt .receipt_header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .merch_receipt .receipt_meta {
        min-width: 0;
        width: auto;
        text-align: left;
    }
    .merch_modal_container .status_badge,
    .merch_receipt .status_badge {
        font-size: 12px;
    }
}

/* MERCH_MSC1: Saved Cards tab in My Account. MERCH_MSC2: the rows are
   white with dark text in every theme, like the checkout card fields,
   and their colours are fixed so a theme cannot make them unreadable. */
#msc_cards .msc_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#msc_cards .msc_intro {
    margin: 0 0 12px;
    color: var(--text);
}

#msc_cards .msc_card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #b9c6d6;
    border-radius: 6px;
    background: #ffffff;
    color: #1a1a1a;
}

#msc_cards .msc_card .merch_icon {
    fill: #4a4a4a;
    flex-shrink: 0;
}

#msc_cards .msc_card_text {
    flex: 1;
    color: #1a1a1a;
}

#msc_cards .msc_card_text strong {
    color: #1a1a1a;
    font-weight: 600;
}

#msc_cards .msc_tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    background: #1e7b3c;
    color: #ffffff;
}

#msc_cards .msc_tag.msc_tag_off {
    background: #b3261e;
    color: #ffffff;
}

#msc_cards .msc_card_actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#msc_cards .msc_default_btn {
    padding: 5px 12px;
    background: #ffffff;
    border: 1px solid #1d6fd6;
    border-radius: 4px;
    color: #1d6fd6;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

#msc_cards .msc_default_btn:hover {
    background: #1d6fd6;
    color: #ffffff;
}

#msc_cards .msc_remove_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #b3261e;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

#msc_cards .msc_remove_btn .merch_icon {
    fill: currentColor;
}

#msc_cards .msc_remove_btn:hover,
#msc_cards .msc_remove_btn.msc_armed {
    background: #fdecea;
    border-color: #b3261e;
}

#msc_cards .msc_empty {
    color: var(--text);
}

@media (max-width: 600px) {
    #msc_cards .msc_card {
        flex-wrap: wrap;
    }
}

/* MERCH_BSG5: Save To Projects and Save to user in the gang sheet and sticker
   builder headers. Theme pills with an icon; round icon buttons on phones.
   Theme colours only (--text, --line, --hover, --accent). */
.header_right #btn_gs_save_project,
.header_right #btn_gs_save_user,
.header_right #st_save_project,
.header_right #st_save_user {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    min-width: 0;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.header_right #btn_gs_save_project,
.header_right #st_save_project {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.header_right #btn_gs_save_project:hover,
.header_right #st_save_project:hover {
    background: var(--accent);
    color: var(--gs_on_accent, #ffffff);
}
.header_right #btn_gs_save_user:hover,
.header_right #st_save_user:hover {
    background: var(--hover);
    border-color: var(--text);
}
.header_right #btn_gs_save_project:disabled,
.header_right #btn_gs_save_user:disabled,
.header_right #st_save_project:disabled,
.header_right #st_save_user:disabled {
    opacity: 0.55;
    cursor: default;
}
.header_right .ms_save_icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    stroke: currentColor;
    fill: none;
}
@media (max-width: 900px) {
    .header_right #btn_gs_save_project,
    .header_right #btn_gs_save_user,
    .header_right #st_save_project,
    .header_right #st_save_user {
        width: 38px;
        padding: 0;
    }
    .header_right #btn_gs_save_project span,
    .header_right #btn_gs_save_user span,
    .header_right #st_save_project span,
    .header_right #st_save_user span {
        display: none;
    }
}

/* MERCH_BSG6: the "Leave this page?" window (merch_leave_guard in common.js).
   Cancel outlined, Save Project gold, Confirm (leave without saving) red
   outline; no empty footer bar. Phones: full width, Save Project first. */
#merch_modal_container[data-modal-id="leave_guard"] #merch_modal_footer {
    display: none;
}
.merch_leave_guard_actions [data-leave_guard] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 120px;
    margin: 0;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.merch_leave_guard_actions [data-leave_guard="cancel"]:hover {
    background: var(--hover);
    border-color: var(--text);
}
.merch_leave_guard_actions [data-leave_guard="save"] {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--gs_on_accent, #ffffff);
}
.merch_leave_guard_actions [data-leave_guard="save"]:hover {
    border-color: color-mix(in srgb, var(--accent) 82%, #ffffff);
    background: color-mix(in srgb, var(--accent) 82%, #ffffff);
}
.merch_leave_guard_actions [data-leave_guard="go"] {
    border-color: color-mix(in srgb, #d64545 70%, transparent);
    color: #e06666;
}
.merch_leave_guard_actions [data-leave_guard="go"]:hover {
    border-color: #c53b3b;
    background: #c53b3b;
    color: #ffffff;
}
@media (max-width: 600px) {
    .merch_leave_guard_actions {
        flex-direction: column;
    }
    .merch_leave_guard_actions [data-leave_guard] {
        width: 100%;
    }
    .merch_leave_guard_actions [data-leave_guard="save"] {
        order: -1;
    }
}
