/* ==========================================================================
   RS Musashi Catalogue — Frontend Styles
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
    --rsmc-primary: #0A2F86;
    --rsmc-text: #333333;
    --rsmc-gray-bg: #EFEFEF;
    --rsmc-light-bg: #EFF1F5;
    --rsmc-border: #DDDDDD;
    --rsmc-placeholder: #9DA4AE;
    --rsmc-required: #CE052C;
    --rsmc-blue-accent: #0085D8;
}

/* ---------- Category Navigation ---------- */
.rsmc-cats-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.rsmc-cat-item {
    width: calc(25% - 15px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--rsmc-gray-bg);
    border-radius: 4px;
    text-decoration: none;
    color: var(--rsmc-text);
    font-size: 18px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    line-height: 28.8px;
    letter-spacing: 1.8px;
    transition: background 0.2s ease, transform 0.15s ease;
    box-sizing: border-box;
}

.rsmc-cat-item:hover {
    background: #e2e2e2;
    transform: translateY(-1px);
    color: var(--rsmc-text);
    text-decoration: none;
}

.rsmc-cat-arrow {
    display: flex;
    flex-shrink: 0;
}

/* ---------- Section Loop ---------- */
.rsmc-loop-wrap {
    display: flex;
    flex-direction: column;
    gap: 70px;
}

.rsmc-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.rsmc-section-bar {
    display: block;
    width: 4px;
    height: 32px;
    background: var(--rsmc-blue-accent);
    flex-shrink: 0;
}

.rsmc-section-title {
    font-size: 32px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 700;
    line-height: 41.6px;
    letter-spacing: 3.2px;
    color: var(--rsmc-text);
    margin: 0;
    padding: 0;
}

/* ---------- Cards Grid ---------- */
.rsmc-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.rsmc-card {
    width: calc(33.333% - 27px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rsmc-card-top {
    position: relative;
    height: 184px;
    border: 1px solid var(--rsmc-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 13px 16px 20px;
    box-sizing: border-box;
}

.rsmc-card-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 191px;
    height: 184px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

.rsmc-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 1;
}

.rsmc-card-title {
    color: var(--rsmc-text);
    font-size: 16px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    line-height: 25.6px;
    letter-spacing: 1.6px;
    flex: 1;
}

.rsmc-card-thumb {
    width: 106px;
    height: 150px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ---------- Download Button ---------- */
.rsmc-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: var(--rsmc-light-bg);
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: var(--rsmc-primary);
    font-size: 15px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 500;
    line-height: 19.5px;
    letter-spacing: 1.5px;
    transition: background 0.2s ease;
}

.rsmc-download-btn:hover {
    background: #dde1ea;
}

/* ---------- Prod Download Button (standalone shortcode) ---------- */
.rsmc-download-btn--prod {
    width: 304px;
    height: 60px;
    background: var(--rsmc-primary);
    border-radius: 4px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    display: inline-flex;
    padding: 0;
    color: #fff;
    font-size: 16px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    line-height: 25.6px;
    letter-spacing: 1.6px;
}

.rsmc-download-btn--prod span {
    color: #fff;
}

.rsmc-download-btn--prod:hover {
    background: #0a2f86;
    opacity: 0.9;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.rsmc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.rsmc-modal {
    background: #fff;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 60px;
    position: relative;
    border-radius: 4px;
    box-sizing: border-box;
}

.rsmc-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--rsmc-text);
    line-height: 1;
    padding: 4px 8px;
}

.rsmc-modal-close:hover {
    color: var(--rsmc-primary);
}

/* ---------- Form Header ---------- */
.rsmc-form-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.rsmc-form-header-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.rsmc-form-dot {
    display: block;
    width: 8px;
    height: 8px;
    background: var(--rsmc-primary);
    border-radius: 9999px;
    flex-shrink: 0;
}

.rsmc-form-heading {
    color: var(--rsmc-text);
    font-size: 23px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 700;
    line-height: 36.8px;
    letter-spacing: 2.3px;
}

.rsmc-form-subtitle {
    color: var(--rsmc-placeholder);
    font-size: 16px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    line-height: 32px;
    letter-spacing: 1.6px;
    margin: 0;
}

/* ---------- Form Fields ---------- */
.rsmc-form-body {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.rsmc-field {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rsmc-label {
    color: #2C2624;
    font-size: 16px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 500;
    line-height: 25.6px;
    letter-spacing: 1.6px;
}

.rsmc-required {
    color: var(--rsmc-required);
}

.rsmc-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--rsmc-border);
    border-radius: 2px;
    font-size: 16px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    line-height: 32px;
    letter-spacing: 1.6px;
    color: var(--rsmc-text);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease;
}

.rsmc-input::placeholder {
    color: var(--rsmc-placeholder);
}

.rsmc-input:focus {
    border-color: var(--rsmc-primary);
}

.rsmc-input.rsmc-error {
    border-color: var(--rsmc-required);
}

/* Name row */
.rsmc-name-row {
    display: flex;
    gap: 16px;
}

.rsmc-name-col {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rsmc-name-label {
    color: #2C2624;
    font-size: 16px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 500;
    line-height: 25.6px;
    letter-spacing: 1.6px;
    white-space: nowrap;
}

.rsmc-name-col .rsmc-input {
    width: 200px;
}

/* Select */
.rsmc-select-wrap {
    position: relative;
}

.rsmc-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23333' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 12px center;
}

/* ---------- Form Footer ---------- */
.rsmc-form-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 32px;
}

.rsmc-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 32px;
    background: var(--rsmc-primary);
    border-radius: 40px;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    line-height: 28.8px;
    letter-spacing: 1.8px;
    transition: opacity 0.2s ease;
    min-width: 200px;
}

.rsmc-submit-btn:hover {
    opacity: 0.9;
}

.rsmc-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rsmc-submit-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rsmc-spin 0.6s linear infinite;
}

@keyframes rsmc-spin {
    to { transform: rotate(360deg); }
}

.rsmc-form-privacy {
    color: var(--rsmc-placeholder);
    font-size: 16px;
    font-family: "Noto Sans TC", sans-serif;
    font-weight: 400;
    line-height: 32px;
    letter-spacing: 1.6px;
    margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .rsmc-cat-item {
        width: calc(50% - 10px);
    }
    .rsmc-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .rsmc-cat-item {
        width: 100%;
    }
    .rsmc-card {
        width: 100%;
    }
    .rsmc-section-title {
        font-size: 24px;
        line-height: 32px;
        letter-spacing: 2px;
    }

    /* Modal RWD */
    .rsmc-modal {
        padding: 30px 20px;
        max-height: 95vh;
    }
    .rsmc-name-row {
        flex-direction: column;
        gap: 12px;
    }
    .rsmc-name-col {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .rsmc-name-col .rsmc-input {
        width: 100%;
    }
    .rsmc-submit-btn {
        width: 100%;
        padding: 18px 24px;
    }
    .rsmc-form-heading {
        font-size: 20px;
    }
    .rsmc-download-btn--prod {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .rsmc-card-top {
        height: auto;
        min-height: 140px;
    }
    .rsmc-card-thumb {
        width: 80px;
        height: 113px;
    }
    .rsmc-card-bg {
        width: 140px;
        height: 140px;
    }
}
