.md-page {
    --md-bg: #ffffff;
    --md-card: #ffffff;
    --md-border: #d7dce6;
    --md-text: #142337;
    --md-subtle: #5f6e83;
    --md-primary: #133B5C;
    --md-accent: #f57c00;
    --md-soft: #eef3fb;
    --md-success: #24a148;
    color: var(--md-text);
}

.md-shell {
    background: var(--md-bg);
    border: 1px solid var(--md-border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 14px 28px rgba(18, 31, 52, 0.08);
    animation: mdAppear .35s ease both;
}

.md-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.md-brand-tag {
    display: inline-block;
    margin: 0 0 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--md-primary);
    background: rgba(15, 63, 120, 0.1);
}

.md-title {
    margin: 0 0 8px;
    font-size: 36px !important;
    line-height: 1.2;
}

.md-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.md-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--md-subtle);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--md-border);
    border-radius: 999px;
    padding: 6px 12px;
}

.md-meta span i {
    color: var(--md-primary);
}

.md-action-wrap {
    flex-shrink: 0;
    min-width: 170px;
}

.md-action-buttons {
    display: grid;
    gap: 8px;
}

.md-btn-favorite {
    background: #fff;
    border-color: #ffd1a9;
    color: #b95f00;
    gap: 8px;
}

.md-btn-favorite:hover {
    background: #fff3e6;
    color: #a65300;
}

.md-btn-favorite.active {
    background: linear-gradient(120deg, #f78614, #ff9d3f);
    border-color: #ea7a07;
    color: #fff;
}

.md-btn-favorite .md-fav-icon {
    font-size: 14px;
}

.md-btn-favorite.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

.md-favorite-feedback {
    display: block;
    margin-top: 6px;
    min-height: 18px;
    font-size: 12px;
    color: #647084;
}

.md-favorite-feedback.is-success {
    color: #1e7d38;
}

.md-favorite-feedback.is-error {
    color: #b02121;
}

.md-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 10px;
    padding: 10px 16px;
    border: 1px solid transparent;
    font-weight: 600;
    text-decoration: none;
    transition: all .25s ease;
}

.md-btn-primary {
    background: var(--md-accent);
    color: #fff;
}

.md-btn-primary:hover {
    background: #d96d00;
    color: #fff;
}

.md-btn-ghost {
    background: #fff1e4;
    border-color: #ffd2a8;
    color: #b95f00;
    min-width: 122px;
}

.md-btn-ghost:hover {
    background: #ffe6cf;
    color: #b95f00;
}

.md-btn-light {
    background: #fff;
    border-color: var(--md-border);
    color: var(--md-primary);
}

.md-btn-light:hover {
    background: #f8fbff;
    color: var(--md-primary);
}

.md-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid var(--md-border);
    border-radius: 12px;
    padding: 7px;
    backdrop-filter: blur(6px);
}

.md-tabs::-webkit-scrollbar {
    display: none;
}

.md-tabs a {
    flex-shrink: 0;
    text-decoration: none;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #51627b;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all .2s ease;
}

.md-tabs a:hover,
.md-tabs a.active {
    color: #fff;
    background: #133B5C;
    border-color: transparent;
}

.md-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
    align-items: start;
}

.md-main {
    min-width: 0;
}

.md-section {
    background: var(--md-card);
    border: 1px solid var(--md-border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 8px 22px rgba(14, 24, 40, 0.06);
    animation: mdRise .45s ease both;
}

.md-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf1f7;
}

.md-section-head h2 {
    margin: 0;
    font-size: 24px !important;
}

.md-empty {
    margin: 0;
    padding: 10px 12px;
    color: var(--md-subtle);
    border: 1px dashed var(--md-border);
    border-radius: 10px;
    background: #fafcff;
}

.md-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
    gap: 16px;
}

.md-gallery {
    background: #ffffff;
    border: 1px solid #d8dfed;
    border-radius: 14px;
    padding: 12px;
}

.md-main-photo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    border-radius: 10px;
    background: linear-gradient(145deg, #fff 0%, #edf2fb 100%);
    border: 1px solid #dde5f3;
    padding: 12px;
    margin-bottom: 10px;
    overflow: visible;
    cursor: crosshair;
}

.md-main-photo-wrap img {
    max-height: 280px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.md-main-photo-wrap #md-main-photo[data-md-lightbox-trigger] {
    cursor: zoom-in;
}

.md-main-photo-wrap.is-zooming {
    box-shadow: 0 0 0 2px rgba(15, 63, 120, 0.18);
}

.md-main-photo-wrap.is-zooming #md-main-photo {
    opacity: 0.9;
}

.md-zoom-pane {
    position: absolute;
    top: 0;
    left: calc(100% + 12px);
    width: min(360px, 40vw);
    height: 100%;
    border-radius: 10px;
    border: 1px solid #cfd9eb;
    box-shadow: 0 16px 32px rgba(12, 26, 46, 0.22);
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 220%;
    display: none;
    pointer-events: none;
    z-index: 6;
}

.md-main-photo-wrap.is-zooming .md-zoom-pane {
    display: block;
}

.md-spec-score {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #6da623;
    color: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: center;
    box-shadow: 0 8px 10px rgba(25, 65, 28, .15);
}

.md-spec-score strong {
    display: block;
    font-size: 16px;
    line-height: 1;
}

.md-spec-score span {
    display: block;
    font-size: 10px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.md-thumbs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.md-thumb {
    border: 1px solid #cfd7e9;
    border-radius: 8px;
    background: #fff;
    padding: 3px;
    cursor: pointer;
}

.md-thumb.active,
.md-thumb:hover {
    border-color: var(--md-primary);
    box-shadow: 0 0 0 2px rgba(15, 63, 120, 0.16);
}

.md-thumb img {
    width: 100%;
    height: 48px;
    object-fit: cover;
    border-radius: 5px;
}

.md-inline-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--md-accent);
    font-weight: 600;
    text-decoration: none;
}

.md-inline-link:hover {
    color: #d96d00;
    text-decoration: underline;
}

.md-key-panel {
    min-width: 0;
}

.md-section-title-wrap h2 {
    margin: 0 0 4px;
    font-size: 28px !important;
}

.md-section-title-wrap p {
    margin: 0 0 12px;
    color: var(--md-subtle);
    font-size: 15px;
}

.md-key-card {
    border-top: 1px solid #e9edf4;
    padding-top: 12px;
    margin-top: 12px;
}

.md-key-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.md-key-head h3 {
    margin: 0;
    font-size: 21px !important;
}

.md-key-head h3 i {
    margin-right: 7px;
    color: var(--md-primary);
}

.md-rating {
    min-width: 140px;
}

.md-rating-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e6ebf5;
    overflow: hidden;
}

.md-rating-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6e9b26, #2f7f2b);
}

.md-rating small {
    display: block;
    text-align: right;
    color: #46711e;
    margin-top: 3px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.md-key-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.md-key-card li {
    position: relative;
    margin: 0 0 8px;
    padding-left: 16px;
    color: #2e3d54;
}

.md-key-card li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #97a5ba;
}

.md-price-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.md-price-item {
    background: #fff;
    border: 1px solid var(--md-border);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.md-price-left {
    min-width: 0;
}

.md-price-left h3 {
    margin: 0 0 4px;
    font-size: 16px !important;
    line-height: 1.28;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.md-store {
    font-size: 13px;
    color: var(--md-subtle);
}

.md-price-right {
    text-align: right;
    min-width: 160px;
    max-width: 100%;
}

.md-price-right strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
    line-height: 1.2;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.md-price-right a {
    color: var(--md-accent);
    text-decoration: none;
    font-weight: 600;
}

.md-price-right a:hover {
    color: #d96d00;
    text-decoration: underline;
}

.md-spec-grid {
    display: grid;
    gap: 12px;
}

.md-spec-card {
    border: 1px solid #e5e9f2;
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
}

.md-spec-card h3 {
    margin: 0 0 8px;
    font-size: 21px !important;
    color: var(--md-primary);
}

.md-spec-card table {
    width: 100%;
}

.md-spec-card tr:not(:last-child) {
    border-bottom: 1px solid #edf2fa;
}

.md-spec-card th,
.md-spec-card td {
    padding: 7px 2px;
    vertical-align: top;
    background: #ffffff;
}

.md-spec-card th {
    width: 38%;
    color: #000000;
    font-weight: 500;
}

.md-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.md-photo-card {
    margin: 0;
    background: #fff;
    border: 1px solid #dde4f0;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    transition: transform .2s ease, box-shadow .2s ease;
}

.md-photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(10, 30, 59, 0.12);
}

.md-photo-card:focus-visible,
.md-main-photo-wrap #md-main-photo[data-md-lightbox-trigger]:focus-visible,
.md-lightbox-close:focus-visible,
.md-lightbox-nav:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.md-photo-card img {
    width: 100%;
    height: 190px;
    object-fit: contain;
    display: block;
}

.md-photo-card figcaption {
    padding: 8px 10px;
    border-top: 1px solid #edf1f8;
    color: #485971;
    text-align: center;
}

body.md-lightbox-open {
    overflow: hidden;
}

.md-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(9, 16, 27, 0.88);
    padding: 36px 80px;
}

.md-lightbox.is-open {
    display: flex;
}

.md-lightbox-figure {
    margin: 0;
    max-width: min(1080px, 100%);
    max-height: 100%;
    display: grid;
    justify-items: center;
    gap: 10px;
}

.md-lightbox-figure img {
    max-width: 100%;
    max-height: calc(100vh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: #f8fbff;
}

.md-lightbox-figure figcaption {
    color: #edf3ff;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.md-lightbox-close,
.md-lightbox-nav {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(18, 31, 52, 0.75);
    color: #ffffff;
    cursor: pointer;
}

.md-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 30px;
    line-height: 1;
}

.md-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 999px;
    font-size: 26px;
    line-height: 1;
}

.md-lightbox-prev {
    left: 20px;
}

.md-lightbox-next {
    right: 20px;
}

.md-lightbox-close:hover,
.md-lightbox-nav:hover {
    background: rgba(19, 59, 92, 0.95);
    border-color: rgba(255, 255, 255, 0.7);
}

.md-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
}

.md-related-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #dbe3f1;
    border-radius: 12px;
    text-decoration: none;
    color: var(--md-text);
    background: #fff;
    transition: all .2s ease;
}

.md-related-card:hover {
    border-color: #9bb5d8;
    transform: translateY(-2px);
    box-shadow: 0 10px 18px rgba(10, 30, 59, 0.08);
}

.md-related-card img {
    width: 60px;
    height: 74px;
    border-radius: 8px;
    object-fit: contain;
    background: #f4f7fd;
    border: 1px solid #e0e7f3;
}

.md-related-card strong {
    display: block;
    margin-bottom: 2px;
    font-size: 16px;
}

.md-related-card small {
    color: #6a7890;
    font-size: 12px;
}

.md-qna-intro {
    margin: 0 0 10px;
    color: var(--md-subtle);
}

.md-qna-form .form-control {
    border-radius: 10px;
}

.md-qna-note {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}

.md-qna-submit-row {
    margin-top: 10px;
    display: flex;
    justify-content: flex-start;
}

.md-qna-submit {
    width: auto;
    min-width: 170px;
}

.md-qna-list {
    display: grid;
    gap: 10px;
}

.md-qna-card {
    border: 1px solid #dbe3f1;
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
}

.md-qna-question {
    margin: 0 0 6px;
    font-size: 18px !important;
    color: #1d2d44;
}

.md-qna-answer {
    margin: 0;
    color: #2b3d57;
    white-space: pre-line;
}

.md-qna-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #708099;
}

.md-qna-meta span {
    background: #f4f7fc;
    border: 1px solid #e2e8f3;
    border-radius: 999px;
    padding: 3px 8px;
}

.md-disclaimer {
    background: #fff5e9;
    border: 1px solid #ffd7ad;
    border-left: 4px solid var(--md-accent);
    border-radius: 12px;
    padding: 12px;
    color: #7a4c1a;
}

.md-disclaimer a {
    color: #a45300;
    font-weight: 600;
}

.md-aside {
    min-width: 0;
}

.md-sticky {
    position: sticky;
    top: 58px;
    display: grid;
    gap: 12px;
}

.md-buy-card,
.md-aside-list {
    background: #fff;
    border: 1px solid var(--md-border);
    border-radius: 12px;
    padding: 12px;
}

.md-buy-card img {
    width: 70px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #e1e6f1;
    border-radius: 8px;
    background: #ffffff;
    margin-bottom: 8px;
    padding: 5px;
}

.md-buy-card h3 {
    margin: 0 0 6px;
    font-size: 21px !important;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.md-buy-price {
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1;
    margin-bottom: 4px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.md-buy-card p {
    margin: 0 0 10px;
    color: #63748c;
    font-size: 13px;
}

.md-buy-card .md-btn {
    margin-bottom: 8px;
}

.md-buy-card .md-btn:last-child {
    margin-bottom: 0px;
}

.md-aside-list h4 {
    margin: 0 0 8px;
    font-size: 18px !important;
}

.md-aside-list a {
    display: block;
    padding: 8px 0;
    color: #2d3f5b;
    text-decoration: none;
    border-top: 1px solid #ecf1f8;
}

.md-aside-list a:hover {
    color: var(--md-primary);
}

.md-section .comments-section {
    margin-top: 0 !important;
}

.md-section .comments-section h5 {
    margin-bottom: 10px;
}

.md-section .comments-section .alert.border.d-flex {
    gap: 10px;
}

@media (max-width: 1199px) {
    .md-layout {
        grid-template-columns: minmax(0, 1fr) 250px;
    }
}

@media (max-width: 991px) {
    .md-title {
        font-size: 30px !important;
    }

    .md-layout {
        grid-template-columns: 1fr;
    }

    .md-price-list {
        grid-template-columns: 1fr;
    }

    .md-sticky {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .md-hero-grid {
        grid-template-columns: 1fr;
    }

    .md-tabs {
        top: 0;
    }

    .md-main-photo-wrap {
        cursor: default;
    }

    .md-zoom-pane {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .md-shell {
        border-radius: 14px;
        padding: 10px;
    }

    .md-top {
        flex-direction: column;
    }

    .md-action-wrap {
        width: 100%;
    }

    .md-action-buttons {
        grid-template-columns: 1fr;
    }

    .md-title {
        font-size: 25px !important;
    }

    .md-meta span {
        font-size: 12px;
        padding: 5px 9px;
    }

    .md-section {
        padding: 12px;
    }

    .md-section-head h2 {
        font-size: 20px !important;
    }

    .md-main-photo-wrap {
        min-height: 250px;
    }

    .md-main-photo-wrap img {
        max-height: 240px;
    }

    .md-thumbs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md-thumb img {
        height: 42px;
    }

    .md-key-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .md-rating {
        width: 100%;
    }

    .md-price-item {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .md-price-right {
        text-align: left;
        min-width: 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .md-price-right strong {
        margin-bottom: 0;
        font-size: 18px;
    }

    .md-spec-card th,
    .md-spec-card td {
        display: block;
        width: 100%;
        padding: 4px 0;
    }

    .md-spec-card th {
        margin-top: 6px;
        color: #133B5C;
    }

    .md-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md-photo-card img {
        height: 142px;
    }

    .md-lightbox {
        padding: 20px 12px 56px;
    }

    .md-lightbox-figure img {
        max-height: calc(100vh - 180px);
    }

    .md-lightbox-close {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 27px;
    }

    .md-lightbox-nav {
        top: auto;
        bottom: 10px;
        transform: none;
        width: 44px;
        height: 44px;
    }

    .md-lightbox-prev {
        left: calc(50% - 56px);
    }

    .md-lightbox-next {
        right: calc(50% - 56px);
    }

    .md-related-grid {
        grid-template-columns: 1fr;
    }

    .md-sticky {
        grid-template-columns: 1fr;
    }

    .md-section .comments-section .alert.border.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .md-section .comments-section .alert.border .d-flex.gap-2 {
        width: 100%;
    }

    .md-section .comments-section .alert.border .d-flex.gap-2 .btn {
        flex: 1;
    }

    #qna .alert.border.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    #qna .alert.border .d-flex.gap-2 {
        width: 100%;
    }

    #qna .alert.border .d-flex.gap-2 .btn {
        flex: 1;
    }

    .md-qna-submit-row {
        width: 100%;
    }

    .md-qna-submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .md-shell,
    .md-section,
    .md-tabs a,
    .md-btn {
        animation: none !important;
        transition: none !important;
    }
}

@keyframes mdAppear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mdRise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
