/* 
 * Custom TikTok & Shopee Buy Buttons & Trust Certification Section
 * Plugin: Nam Dược Lão Nông Custom
 */

/* ===================================================
   1. NÚT ĐẶT HÀNG TIKTOK & SHOPEE
   =================================================== */
.ndln-custom-buy-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
    clear: both;
    width: 100%;
}

.ndln-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    text-align: center;
    border: none;
    outline: none;
}

.ndln-buy-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.ndln-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.ndln-buy-btn:hover svg {
    transform: scale(1.1);
}

/* TikTok Button */
.ndln-buy-btn-tiktok {
    background: #010101;
    color: #ffffff !important;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ndln-buy-btn-tiktok:hover {
    background: #161823;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(254, 44, 85, 0.25), 0 0 12px rgba(37, 244, 238, 0.2);
}

/* Shopee Button */
.ndln-buy-btn-shopee {
    background: #EE4D2D;
    color: #ffffff !important;
}

.ndln-buy-btn-shopee:hover {
    background: #e23b19;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(238, 77, 45, 0.35);
}

@media (max-width: 576px) {
    .ndln-custom-buy-buttons-wrapper {
        flex-direction: column;
    }
    
    .ndln-buy-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================================
   2. KHỐI CHỨNG NHẬN CHẤT LƯỢNG & HỒ SƠ CÔNG BỐ
   =================================================== */
.ndln-cert-section {
    margin-top: 35px;
    padding: 30px 24px;
    background: linear-gradient(180deg, #f8fbf9 0%, #ffffff 100%);
    border: 1px solid #e1efe6;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(27, 94, 32, 0.04);
    clear: both;
    font-family: inherit;
    color: #2d3748;
}

.ndln-cert-header {
    text-align: center;
    margin-bottom: 25px;
}

.ndln-cert-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 50px;
    margin-bottom: 10px;
    border: 1px solid #c8e6c9;
}

.ndln-cert-badge-pill svg {
    width: 14px;
    height: 14px;
    fill: #2e7d32;
}

.ndln-cert-title-main {
    font-size: 22px;
    font-weight: 800;
    color: #1b5e20;
    margin: 6px 0 10px 0;
    line-height: 1.35;
}

.ndln-cert-subtitle {
    font-size: 14px;
    color: #55695b;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Feature Badges Cards */
.ndln-cert-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.ndln-cert-feature-card {
    background: #ffffff;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ndln-cert-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 125, 50, 0.08);
    border-color: #a5d6a7;
}

.ndln-cert-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ndln-cert-icon-wrapper svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ndln-cert-feature-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 4px 0;
}

.ndln-cert-feature-card p {
    font-size: 13px;
    color: #4a5568;
    margin: 0;
    line-height: 1.5;
}

.ndln-cert-feature-card .ndln-cert-code {
    display: inline-block;
    background: #f1f8f3;
    color: #1b5e20;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    margin-top: 4px;
    border: 1px solid #d0e7d5;
}

/* Link xác thực Chi cục QLCL Nông Lâm Thuỷ Sản */
.ndln-cert-gov-box {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 6px 16px rgba(27, 94, 32, 0.2);
}

.ndln-cert-gov-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ndln-cert-gov-text svg {
    width: 32px;
    height: 32px;
    fill: #ffd54f;
    flex-shrink: 0;
}

.ndln-cert-gov-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 3px;
}

.ndln-cert-gov-desc {
    font-size: 13px;
    opacity: 0.92;
    margin: 0;
}

.ndln-cert-gov-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #1b5e20 !important;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ndln-cert-gov-btn:hover {
    background: #f0fdf4;
    color: #0d4412 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ndln-cert-gov-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Gallery Grid */
.ndln-cert-gallery-title {
    font-size: 16px;
    font-weight: 700;
    color: #2e7d32;
    margin: 20px 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ndln-cert-gallery-title svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ndln-cert-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 991px) {
    .ndln-cert-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ndln-cert-gallery-grid {
        grid-template-columns: 1fr;
    }
}

.ndln-cert-item {
    background: #ffffff;
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

.ndln-cert-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
    border-color: #81c784;
}

.ndln-cert-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 140%; /* Tỉ lệ khổ giấy A4 đứng */
    background: #f8fafc;
    overflow: hidden;
}

.ndln-cert-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.4s ease;
}

.ndln-cert-item:hover .ndln-cert-img-wrap img {
    transform: scale(1.04);
}

.ndln-cert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(27, 94, 32, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ndln-cert-item:hover .ndln-cert-overlay {
    opacity: 1;
}

.ndln-cert-zoom-badge {
    background: #ffffff;
    color: #1b5e20;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ndln-cert-zoom-badge svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.ndln-cert-info {
    padding: 12px 14px;
    background: #ffffff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ndln-cert-title {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 3px 0;
    line-height: 1.35;
}

.ndln-cert-tag {
    font-size: 11px;
    color: #2e7d32;
    font-weight: 600;
}

/* ===================================================
   3. LIGHTBOX POPUP MODAL
   =================================================== */
.ndln-cert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.ndln-cert-modal.active {
    display: flex;
}

.ndln-cert-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 20, 15, 0.88);
    backdrop-filter: blur(4px);
}

.ndln-cert-modal-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: ndlnFadeIn 0.25s ease-out;
}

@keyframes ndlnFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.ndln-cert-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 85vh;
}

.ndln-cert-modal-body img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: #ffffff;
}

.ndln-cert-modal-caption {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 18px;
    border-radius: 20px;
}

.ndln-cert-modal-close {
    position: absolute;
    top: -40px;
    right: -10px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease;
}

.ndln-cert-modal-close:hover {
    transform: scale(1.2);
    color: #81c784;
}

.ndln-cert-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 20px;
    padding: 14px 18px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.ndln-cert-modal-nav:hover {
    background: #1b5e20;
    border-color: #81c784;
}

.ndln-cert-prev {
    left: -70px;
}

.ndln-cert-next {
    right: -70px;
}

@media (max-width: 768px) {
    .ndln-cert-modal-nav {
        padding: 8px 12px;
        font-size: 16px;
    }
    .ndln-cert-prev { left: 5px; }
    .ndln-cert-next { right: 5px; }
    .ndln-cert-modal-close { top: -35px; right: 5px; }
    .ndln-cert-gov-box { flex-direction: column; align-items: flex-start; }
    .ndln-cert-gov-btn { width: 100%; justify-content: center; }
}
