/* Layout adjustments specific to the new archive. The legacy theme already styles
   .pxr-plate-list-wrapper, .plate-serialnum, .bio-buttonx etc — we don't override. */

.afm-mw-archive { padding: 24px 0; }

.afm-mw-archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    max-width: 42rem;
    margin: 0 auto 5rem;
}
.afm-mw-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    row-gap: 4rem;
    column-gap: 2rem;
    justify-items: center;
}
.afm-mw-grid .order-item-show {
    text-align: center;
    aspect-ratio: 1.6 / 1;
    width: 100%;
    max-width: 359px;
}
.afm-mw-plate-card {
    background-color: #b8b8b8;
    background-image: url('images/plate-bg.png'), linear-gradient(180deg, #7a7a7a 0%, #b8b8b8 30%, #e0e0e0 50%, #b8b8b8 70%, #7a7a7a 100%);
    background-size: cover;
    background-position: center;
    height: 100%;
    padding: 6px;
    position: relative;
}
.afm-mw-plate-card-box {
    border: 1px solid #E5E7EB;
    height: 100%;
    padding: 1px;
}
.afm-mw-plate-card-content {
    border: 1px solid #d1d5db80;
    height: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}
.afm-mw-plate-card-info h3 {
    font-size: 1.25rem;
    line-height: 1.75rem;
    margin: 0;
}
.afm-mw-plate-card-info p {
    font-size: 1rem;
    line-height: 1.5rem;
    margin: 4px 0 0;
}
.afm-mw-plate-card-info .plate-serialnum {
    position: absolute;
    bottom: 1rem;
    right: 2rem;
}
.afm-mw-plate-card-content .screw.top.left {
    top: 0.875rem;
    left: 0.875rem;
}
.afm-mw-plate-card-content .screw.top.right {
    top: 0.875rem;
    right: 0.875rem;
}
.afm-mw-plate-card-content .screw.bottom.left {
    bottom: 0.875rem;
    left: 0.875rem;
}
.afm-mw-plate-card-content .screw.bottom.right {
    bottom: 0.875rem;
    right: 0.875rem;
}
.afm-mw-plate-card-content .screw {
    position: absolute;
    width: 0.625rem;
    height: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid rgb(107 114 128);
    background-image: linear-gradient(to bottom right, #e5e7eb, #9ca3af);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}
.afm-mw-plate-card-content .screw span {
    width: 100%;
    height: 1px;
    background-color: rgb(75 85 99);
    box-sizing: border-box;
    transform: translate(0, 0) rotate(45deg) skewX(0) skewY(0) scaleX(1) scaleY(1);
}
.afm-mw-plate-card-content .screw.top.right span {
    transform: translate(0, 0) rotate(-12deg) skewX(0) skewY(0) scaleX(1) scaleY(1);
}
.afm-mw-plate-card-content .screw.bottom.left span {
    transform: translate(0, 0) rotate(90deg) skewX(0) skewY(0) scaleX(1) scaleY(1);
}
.afm-mw-plate-card-content .screw.bottom.right span {
    transform: translate(0, 0) rotate(60deg) skewX(0) skewY(0) scaleX(1) scaleY(1);
}
.afm-mw-plate-trigger {
    margin-top: 20px;
    background-color: #fff;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: #004B87;
    border: 1px solid #E5E7EB;
    padding: 4px 14px;
}
.afm-mw-plate-trigger:hover {
    border-color: #004B87;
}
.afm-mw-search {
    display: flex;
    gap: 8px;
    width: 100%;
}
.afm-mw-search .input_search {
    width: 100%;
    padding: 6px 10px;
    min-height: 58px;
    border: 1px solid #E5E7EB;
    box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
}
.afm-mw-search .input_search:focus,
.afm-mw-search .input_search:active {
    box-shadow: rgb(255, 255, 255) 0px 0px 0px 0px, rgb(0, 75, 135) 0px 0px 0px 2px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: transparent;
}
.afm-mw-search button {
    background: #004B87;
    color: #fff;
    border: none;
    min-width: 95px;
}
.afm-mw-search button:hover {
    background-color: #003A68;
}
.afm-mw-search button:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: rgb(255, 255, 255) 0px 0px 0px 2px, rgb(0, 75, 135) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
}
.afm-mw-search .afm-mw-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 95px;
    padding: 6px 16px;
    background: #fff;
    color: #004B87;
    border: 1px solid #004B87;
    text-decoration: none;
    font-weight: 600;
    line-height: 1;
}
.afm-mw-search .afm-mw-reset.is-hidden {
    display: none;
}
.afm-mw-search .afm-mw-reset:hover {
    background: #EFF6FF;
    color: #003A68;
    text-decoration: none;
}
.afm-mw-search .afm-mw-reset:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: rgb(255, 255, 255) 0px 0px 0px 2px, rgb(0, 75, 135) 0px 0px 0px 4px, rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
}
.afm-mw-archive-header p {
    width: 100%;
    padding: 17px 24px;
    margin: 0;
    border: 1px solid #DBEAFE;
    background: #EFF6FF;
    color: #1E3A8A;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.afm-mw-archive-header p a {
    color: #004B87;
    font-weight: 600;
}
.afm-mw-empty { text-align: center; padding: 48px 16px; color: #555; }

.afm-mw-grid-loading { opacity: 0.5; pointer-events: none; transition: opacity 150ms ease; }
#afm-mw-pagination {
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 10px;
}
#afm-mw-pagination.plate-order-list-pagination span.current {
    border: none;
    position: relative !important;
}
#afm-mw-pagination.plate-order-list-pagination a,
#afm-mw-pagination.plate-order-list-pagination span {
    padding: 0 12px;
}
#afm-mw-pagination.plate-order-list-pagination .prev,
#afm-mw-pagination.plate-order-list-pagination .next {
    padding: 0;
}
#afm-mw-pagination span.page-numbers.current:before {
    border-bottom: 3px solid #003288;
    width: 32px;
    left: 50%;
    transform: translate(-50%, 0);
}
/* Modal */
.afm-mw-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.afm-mw-modal[hidden] { display: none; }

.afm-mw-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.afm-mw-modal-content {
    position: relative;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 80rem;
    width: 80vw;
    max-height: 90vh;
    overflow-y: auto;
}

.afm-mw-modal-close {
    position: absolute;
    top: 25px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: none;
    border: 0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #9CA3AF;
}
.afm-mw-modal-close:hover { color: #000; }

.afm-mw-modal-loading {
    padding: 60px 0;
    text-align: center;
    color: #666;
    font-style: italic;
}
.afm-mw-modal-title {
    padding: 24px;
    border-bottom: 1px solid #E5E7EB;
}
.afm-mw-modal-title .afm-mw-modal-name {
    color: #004B87;
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 600;
}
.afm-mw-modal-body-content {
    display: flex;
    gap: 3rem;
    align-items: start;
    padding: 15px;
}
.afm-mw-modal-body-content.no-image {
    gap: 0;
}
.afm-mw-modal-body .pxr-plate-wrapper {
    border: none;
}
.afm-mw-modal-body .afm-mw-plate-card {
    width: 100%;
    max-width: 370px;
    height: 217px;
    margin: 0 auto;
}
@media (max-width: 767px) {
    .afm-mw-modal-body { grid-template-columns: 1fr; }
    .afm-mw-modal-body-content {
        flex-direction: column;
    }
    .afm-mw-modal-content {
        max-width: 90rem;
        width: 90vw;
    }
    .pxr-uploaded-wrapper {
        width: 100%;
    }
    .pxr-uploaded-wrapper img {
        max-width: 370px;
        margin: 0 auto;
    }
}

@media (min-width: 768px) {
    .afm-mw-modal-body-content {
        padding: 30px;
    }
    .afm-mw-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .afm-mw-search .input_search {
        padding: 6px 20px;
    }
    .afm-mw-search button,
    .afm-mw-search .afm-mw-reset {
        min-width: 145px;
    }
    #afm-mw-pagination {
        gap: 20px;
    }
    .afm-mw-modal-body-content:not(.no-image) .sidex-bar {
        width: 45%;
    }
    .afm-mw-modal-body-content:not(.no-image) .main-conxtenx {
        width: 65%;
    }
}
@media (min-width: 1200px) {
    .afm-mw-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.afm-mw-modal-image {
    margin-bottom: 20px;
}
.afm-mw-modal-image img { max-width: 100%; height: auto; display: block; }
.afm-mw-modal-video iframe { max-width: 100%; }

.afm-mw-modal-name { font-weight: 700; font-size: 18px; }
.afm-mw-modal-bio {
    margin: 0 0 15px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.afm-mw-modal-error { color: #b32d2e; font-weight: 600; }
