/* ==========================================================================
   DETAIL MERCHANDISE PREMIUM LAYOUT
   ========================================================================== */
a { text-decoration: none !important; }

.merch-detail-section {
    padding-bottom: 80px;
}

.merch-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr;
    gap: 40px;
    align-items: start;
    font-family: 'Montserrat', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Gallery --- */
.md-main-img {
    width: 100%;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.md-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.md-thumb-list {
    display: flex;
    gap: 10px;
}
.md-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background: #f8fafc;
}
.md-thumb.active {
    border-color: #159C33;
}
.md-thumb img {
    width: 100%; height: 100%; object-fit: cover;
}

/* --- Info --- */
.md-title {
    font-size: 26px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 8px;
}
.md-price {
    font-size: 22px;
    font-weight: 800;
    color: #1a202c;
}
.md-divider {
    height: 1px; background: #edf2f7; margin: 25px 0;
}
.variant-label {
    font-size: 13px; font-weight: 700; color: #4a5568; margin-bottom: 12px;
}
.variant-label span { color: #a0aec0; font-weight: 500; }
.variant-options { display: flex; gap: 8px; margin-bottom: 25px; flex-wrap: wrap; }
.v-btn {
    min-width: 45px; height: 35px; border-radius: 8px; border: 1.5px solid #edf2f7;
    background: #fff; font-size: 13px; font-weight: 600; color: #4a5568;
    transition: all 0.2s;
    cursor: pointer;
}
.v-btn:hover { border-color: #159C33; color: #159C33; }
.v-btn.active {
    background: #E6F4EA; border-color: #159C33; color: #159C33;
}

.md-desc-box { 
    margin-top: 15px; 
    word-break: break-word; 
    overflow-wrap: break-word; 
}
.md-desc-box #desc-content.collapsed {
    max-height: 100px;
    transition: max-height 0.3s ease;
}
.md-desc-box #desc-content.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; width: 100%; height: 40px;
    background: linear-gradient(transparent, #fff);
}
.md-desc-box h3 { font-size: 15px; font-weight: 700; color: #1a202c; margin-bottom: 12px; }
.read-more-link { font-size: 13px; font-weight: 700; color: #159C33; text-decoration: none; cursor: pointer; display: block; margin-top: 5px; }

/* --- Checkout Widget --- */
.widget-card {
    border: 1px solid #edf2f7; border-radius: 15px; padding: 25px;
    background: #fff; box-shadow: 0 15px 40px rgba(0,0,0,0.03);
}
.widget-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 18px; color: #1a202c; }
.wc-product { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.wc-product img { width: 45px; height: 45px; border-radius: 8px; object-fit: cover; }
.wc-product span { font-size: 13px; color: #718096; font-weight: 500; }

.wc-qty-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.qty-control { display: flex; align-items: center; border: 1px solid #edf2f7; border-radius: 8px; overflow: hidden; }
.qty-btn { width: 32px; height: 32px; border: none; background: #fff; font-size: 11px; color: #4a5568; cursor: pointer; }
.qty-btn:hover { background: #f8fafc; }
.qty-btn.plus.active { background: #159C33; color: #fff; }

.wc-subtotal { display: flex; justify-content: space-between; margin-bottom: 25px; align-items: center; }
.wc-subtotal .label { font-size: 13px; color: #a0aec0; }
.wc-subtotal .value { font-size: 18px; font-weight: 800; color: #1a202c; }

.btn-buy {
    width: 100%; background: #159C33; color: #fff; border: none; height: 48px;
    border-radius: 12px; font-weight: 800; font-size: 14px; margin-bottom: 12px; transition: 0.3s;
}
.btn-buy:hover:not(:disabled) { background: #107c28; box-shadow: 0 5px 15px rgba(21, 156, 51, 0.2); }
.btn-buy:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-share {
    width: 100%; background: transparent; color: #a0aec0; border: none; font-size: 13px;
    display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; cursor: pointer;
}

/* --- Related --- */
.other-products-section { background: #f8fafc; padding: 70px 0; margin-top: 40px; }
.section-header-flex h2 { font-size: 22px; font-weight: 800; }
.view-all-link { font-size: 13px; font-weight: 600; text-decoration: none; color: #159C33; }

.merch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.merch-card {
    background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}
.merch-card:hover { transform: translateY(-5px); }
.m-card-img { height: 220px; }
.m-card-img img { width: 100%; height: 100%; object-fit: cover; }
.m-card-body { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.m-card-body h4 { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.m-card-desc { font-size: 12px; color: #a0aec0; margin-bottom: 10px; line-height: 1.4; }
.m-card-price { font-size: 16px; font-weight: 800; color: #159C33; margin-top: auto; }

/* --- Modal Checkout --- */
#checkoutModal .modal-content {
    border-radius: 20px;
    overflow: hidden;
}
#checkoutModal .modal-header {
    border-bottom: none;
    padding: 25px 30px;
}
#checkoutModal .modal-body {
    padding: 30px;
}
#checkoutModal .form-label {
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 8px;
}
#checkoutModal .form-control {
    border-radius: 12px;
    padding: 12px 15px;
    border: 1px solid #edf2f7;
    background: #f8fafc;
    font-size: 14px;
    transition: 0.3s;
}
#checkoutModal .form-control:focus {
    background: #fff;
    border-color: #159C33;
    box-shadow: 0 0 0 4px rgba(21, 156, 51, 0.1);
    outline: none;
}
#checkoutModal .modal-footer {
    border-top: 1px solid #edf2f7;
    padding: 20px 30px;
}
#checkoutModal .btn-success {
    background: #159C33;
    border: none;
    border-radius: 10px;
    padding: 12px 25px;
    font-size: 14px;
}
#checkoutModal .btn-light {
    border-radius: 10px;
    padding: 12px 25px;
    font-size: 14px;
    background: #f1f5f9;
}

.modal {
    display: none;
}
.modal.show {
    display: block;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .merch-detail-grid { grid-template-columns: 1fr 1fr; }
    .md-checkout-widget { grid-column: span 2; position: static; margin-top: 20px; }
    .merch-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .merch-detail-grid { grid-template-columns: 1fr; }
    .md-checkout-widget { grid-column: span 1; }
}
