#tg-vto-wrapper{
    max-width:600px;
}

#tg-vto-wrapper label{
    font-weight:bold;
}

#tg-submit{
    width:100%;
    height:52px;
    background:#0073aa;
    color:#fff;
    border:none;
    border-radius:10px;
    font-size:18px;
    font-weight:600;
    cursor:pointer;
    transition:.3s;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:8px;
}

#tg-submit:hover{
    background:#005f8d;
}

#tg-result{
    margin-top:20px;
}

/* ===============================
   Produk Dipilih
================================= */

.tg-selected-card{
    max-width:420px;
    margin:20px auto;
    padding:18px;
    background:#ffffff;
    border:1px solid #e5e5e5;
    border-radius:14px;
    text-align:center;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
}

.tg-selected-title{
    font-size:18px;
    font-weight:700;
    margin-bottom:15px;
}

.tg-selected-image{
    width:100%;
    max-width:220px;
    border-radius:12px;
    margin-bottom:15px;
}

.tg-selected-name{
    font-size:18px;
    font-weight:600;
    margin-bottom:8px;
}

.tg-selected-price{
    font-size:20px;
    color:#28a745;
    font-weight:700;
    margin-bottom:18px;
}

#tg-change-product{
    width:100%;
    background:#0073aa;
    color:#fff;
    border:none;
    padding:12px;
    border-radius:8px;
    cursor:pointer;
    font-size:15px;
    transition:.3s;
}

#tg-change-product:hover{
    background:#005f8d;
}

/* Area Produk Dipilih */
#tg-selected-info{
    display:none;
    width:100%;
    margin:20px 0;
    padding:0 !important;
    background:transparent !important;
    border:none !important;
    box-shadow:none !important;
}

/* Mobile */
@media (max-width:768px){

    .tg-selected-card{
        width:100%;
        max-width:100%;
        margin:15px auto;
        padding:15px;
        box-sizing:border-box;
    }

    .tg-selected-image{
        max-width:100%;
        height:auto;
    }

    .tg-selected-name{
        font-size:20px;
    }

    .tg-price-new{
        font-size:24px;
    }

}

/* Tombol buka katalog */

.tg-open-catalog{

    width:100%;
    padding:15px;

    background:#0073aa;

    color:#fff;

    border:none;

    border-radius:10px;

    font-size:18px;

    font-weight:600;

    cursor:pointer;

    transition:.3s;

}

.tg-open-catalog:hover{

    background:#005f8d;

}

/* ===================================
   POPUP KATALOG
=================================== */

.tg-modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.65);
    z-index:99999;
    padding:30px;
    overflow:auto;
}

.tg-modal-content{
    background:#fff;
    max-width:1100px;
    margin:30px auto;
    border-radius:14px;
    overflow:hidden;
    box-shadow:0 20px 60px rgba(0,0,0,.25);
}

.tg-modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 25px;
    border-bottom:1px solid #eee;
}

.tg-modal-header h3{
    margin:0;
    font-size:24px;
}

#tg-close-catalog{
    border:none;
    background:none;
    font-size:30px;
    cursor:pointer;
}

.tg-modal-body{
    padding:25px;
    max-height:75vh;
    overflow-y:auto;
}

/* Mobile */

@media(max-width:768px){

    .tg-modal{
        padding:0;
    }

    .tg-modal-content{
        width:100%;
        height:100%;
        margin:0;
        border-radius:0;
    }

    .tg-modal-body{
        max-height:calc(100vh - 70px);
    }

}

/* ==========================
   SEARCH
========================== */

.tg-search-box{
    margin-bottom:20px;
}

#tg-search-product{
    width:100%;
    padding:14px 18px;
    border:1px solid #ddd;
    border-radius:10px;
    font-size:16px;
    box-sizing:border-box;
}

/* ==========================
   CATEGORY
========================== */

.tg-category-bar{
    display:flex;
    gap:10px;
    overflow-x:auto;
    margin-bottom:20px;
    padding-bottom:5px;
}

.tg-category-bar button{
    white-space:nowrap;
    border:none;
    background:#f2f2f2;
    padding:10px 18px;
    border-radius:30px;
    cursor:pointer;
    font-size:14px;
    transition:.25s;
}

.tg-category-bar button.active{
    background:#0073aa;
    color:#fff;
}

/* ==========================
   GRID
========================== */

#tg-product-grid{
    display:block;
    width:100%;
}

@media(max-width:768px){

    #tg-product-grid{
        display:block;
        width:100%;
    }

}

/* ===================================
   PRODUCT GRID
=================================== */

.tg-product-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:20px;
}

.tg-product-card{
    background:#fff;
    border:1px solid #e5e5e5;
    border-radius:14px;
    overflow:hidden;
    padding:15px;
    text-align:center;
    transition:.25s;
    box-shadow:0 3px 10px rgba(0,0,0,.06);
}

.tg-product-card:hover{
    transform:translateY(-4px);
    box-shadow:0 10px 25px rgba(0,0,0,.12);
}

.tg-product-image img{
    width:100%;
    height:230px;
    object-fit:cover;
    border-radius:10px;
}

.tg-product-name{
    font-size:18px;
    font-weight:600;
    margin:15px 0 8px;
    line-height:1.4;
    min-height:50px;
}

.tg-product-price{
    color:#169c3c;
    font-weight:bold;
    font-size:18px;
    margin-bottom:15px;
}

.tg-select-product{
    width:100%;
    border:none;
    background:#0073aa;
    color:#fff;
    padding:12px;
    border-radius:8px;
    cursor:pointer;
    font-size:15px;
    font-weight:600;
    transition:.25s;
}

.tg-select-product:hover{
    background:#005f8d;
}

.tg-buy-button{
    display:block;
    width:100%;
    margin-top:10px;
    padding:12px;
    background:#28a745;
    color:#fff;
    text-align:center;
    text-decoration:none;
    border-radius:8px;
    font-weight:600;
    transition:.25s;
}

.tg-buy-button:hover{
    background:#218838;
}

@media (max-width:768px){

    .tg-product-grid{

        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:12px;
        width:100%;

    }

    .tg-product-card{

        width:100%;
        min-width:0;
        padding:10px;
        box-sizing:border-box;

    }

    .tg-product-image img{

        width:100%;
        height:140px;
        object-fit:cover;

    }

    .tg-product-name{

        font-size:14px;
        line-height:1.3;
        min-height:38px;

        display:-webkit-box;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
        overflow:hidden;

    }

    .tg-product-price{

        font-size:15px;

    }

    .tg-select-product{

        width:100%;
        padding:10px;
        font-size:14px;

    }

}

/* =====================================
   MOBILE UI FIX v1
===================================== */

@media (max-width:768px){

    .tg-modal{
        padding:0;
    }

    .tg-modal-content{
        width:100%;
        height:100vh;
        margin:0;
        border-radius:0;
        display:flex;
        flex-direction:column;
    }

    .tg-modal-header{
        padding:15px;
        flex-shrink:0;
    }

    .tg-modal-body{
        flex:1;
        overflow-y:auto;
        padding:15px;
    }

    .tg-product-grid,
    #tg-product-grid{

        display:grid;
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:12px;

    }

    .tg-product-card{

        width:100%;
        padding:10px;
        box-sizing:border-box;

    }

    .tg-product-image img{

        width:100%;
        height:150px;
        object-fit:cover;

    }

    .tg-product-name{

        font-size:14px;
        line-height:1.35;
        min-height:38px;

        display:-webkit-box;
        -webkit-line-clamp:2;
        -webkit-box-orient:vertical;
        overflow:hidden;

    }

    .tg-product-price{

        font-size:15px;

    }

    .tg-select-product{

        width:100%;
        padding:10px;
        font-size:14px;

    }

}

/* ===== FIX POPUP MOBILE ===== */
@media (max-width:768px){

    #tg-product-grid{
        display:block !important;
        width:100% !important;
    }

    .tg-product-grid{
        display:grid !important;
        width:100% !important;
        max-width:100% !important;

        grid-template-columns:repeat(2,minmax(150px,1fr)) !important;

        justify-content:stretch !important;
        align-items:start;
        gap:16px !important;
    }

    .tg-product-card{
        width:100% !important;
        max-width:none !important;
        min-width:0 !important;
    }

    .tg-product-image img{
        width:100% !important;
        height:180px !important;
        object-fit:cover;
    }

    .tg-select-product{
        white-space:nowrap;
    }

}

/* =====================================
   UPLOAD FOTO MODERN
===================================== */

.tg-upload-wrapper{
    width:100%;
    margin-bottom:25px;
}

.tg-upload-label{
    display:block;
    font-size:20px;
    font-weight:700;
    margin-bottom:12px;
}

#tg-upload-box{

    width:100%;
    min-height:360px;

    border:2px dashed #d6d6d6;
    border-radius:18px;

    background:#fafafa;

    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction:column;

    cursor:pointer;

    transition:.3s;

    overflow:hidden;
}

#tg-upload-box:hover{

    border-color:#0073aa;
    background:#f3faff;

}

#tg-upload-placeholder{

    text-align:center;
    padding:30px;

}

.tg-upload-icon{

    font-size:70px;
    margin-bottom:18px;

}

.tg-upload-title{

    font-size:22px;
    font-weight:700;
    margin-bottom:10px;

}

.tg-upload-subtitle{

    color:#777;
    font-size:15px;

}

#tg-preview-image{

    width:100%;
    max-height:550px;

    object-fit:contain;

    display:block;

}

#tg-change-photo{

    margin-top:15px;

    width:100%;

    padding:14px;

    border:none;

    border-radius:10px;

    background:#0073aa;

    color:#fff;

    font-size:16px;

    font-weight:600;

    cursor:pointer;

    transition:.3s;

}

#tg-change-photo:hover{

    background:#005f8d;

}

/* ===========================
   MOBILE
=========================== */

@media(max-width:768px){

    #tg-upload-box{

        min-height:260px;
        border-radius:14px;

    }

    .tg-upload-icon{

        font-size:55px;

    }

    .tg-upload-title{

        font-size:18px;

    }

    .tg-upload-subtitle{

        font-size:13px;

    }

    #tg-preview-image{

        max-height:380px;

    }

}

/* =======================================
   PHOTO PICKER
======================================= */

.tg-photo-picker{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.45);

    display:none;

    justify-content:center;

    align-items:flex-end;

    z-index:99999;

}

.tg-photo-picker-content{

    width:100%;

    max-width:450px;

    background:#fff;

    border-radius:20px 20px 0 0;

    padding:25px;

    animation:tgPicker .25s ease;

}

.tg-photo-picker-content h3{

    margin:0 0 20px;

    text-align:center;

    font-size:20px;

}

.tg-photo-picker-content button{

    width:100%;

    padding:15px;

    margin-bottom:12px;

    border:none;

    border-radius:12px;

    font-size:16px;

    font-weight:600;

    cursor:pointer;

}

#tg-open-camera{

    background:#111827;

    color:#fff;

}

#tg-open-gallery{

    background:#2563eb;

    color:#fff;

}

#tg-close-picker{

    background:#e5e7eb;

}

@keyframes tgPicker{

    from{

        transform:translateY(100%);

        opacity:0;

    }

    to{

        transform:translateY(0);

        opacity:1;

    }

}

.tg-load-more-wrap{
    display:flex;
    justify-content:center;
    margin:25px 0;
}

.tg-load-more-btn{
    background:#0b76b7;
    color:#fff;
    border:none;
    border-radius:10px;
    padding:12px 28px;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
    transition:.25s;
    min-width:220px;
}

.tg-load-more-btn:hover{
    background:#095d90;
    transform:translateY(-2px);
}

.tg-load-more-btn:disabled{
    opacity:.7;
    cursor:not-allowed;
}