/* Pentru inputuri/butoane în search */
.editbox_search,
.editbox_search2,
.editbox_search_login {
    box-sizing: border-box;
    max-width: 100%;
}
.resp-mobile-toggle
{
    display: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   1. DESKTOP MIC (≤ 1280px) — site-ul e construit pe 1262px fix.
      Trecerea spre fluid începe aici: scoatem lățimile fixe pe wrappers și
      lăsăm conținutul să respire în viewport.
   ───────────────────────────────────────────────────────────────────────────── */
@media screen and (max-width: 1280px) {

    /* Containere principale: layout.css setează 1262px hard-coded */
    div#container,
    div#header,
    div#content {
        width: auto;
        max-width: 100%;
    }

    /* Marginile decorative din .bg19 = "margin:0 25px;" — pe ecrane mici
       le reducem ca să maximizăm spațiul. */
    .bg19 {
        margin: 0 10px;
    }

    /* Cele trei "rame" de top din lib/libview (.bg32/.bg33/.bg34) sunt 1262px
       fix și conțin imagini de fundal pe colțuri. Le facem fluide. */
    .bg32,
    .bg33,
    .bg34 {
        width: auto !important;
        max-width: 100%;
    }

    /* Footer-ul .bg48 e tot 1262px */
    .bg48 {
        width: auto;
        max-width: 100%;
    }

    /* Slider-ul mare din pagina prima: .bg291 = 870px / .bg301 = 850px */
    .bg291 {
        width: 100% !important;
        max-width: 100%;
    }
    .bg301 {
        width: auto !important;
        max-width: 100%;
        left: 0;
        right: 0;
        box-sizing: border-box;
    }

    /* Suggestion box din search.php are width:1200px hard-coded pe inline style */
    .suggest {
        width: auto !important;
        max-width: calc(100vw - 60px);
        right: 30px;
    }

    /* Marja imaginilor de header-decor (bg35, bg47 — colțuri stânga/dreapta) */
    .bg35,
    .bg47 {
        background-position: top center;
    }
}



@media screen and (max-width: 1024px) {

    /* Ascundem coloanele decorative de 25px (.bg35 / .bg47) — sunt umpluturi
       cu imagini de colț care n-au sens pe ecran îngust. */
    .bg35,
    .bg47 {
        display: none !important;
    }
    /* Și celulele <td width="25"> / <td width="25px"> care le conțin */
    td[width="25"],
    td[width="25px"] {
        display: none !important;
    }

    /* Spacer-ele de 38px între coloane (cu <img src="img/vid.gif" width="38">)
       le facem 0 ca să nu mai consume spațiu */
    td[width="38"] {
        width: 10px !important;
    }
    td[width="38"] > div {
        width: auto !important;
    }
    td[width="38"] > div > img {
        width: 0 !important;
        height: 1px;
    }

    /* Containerul principal de conținut: padding redus */
    .bg13 {
        padding: 15px 12px 10px 12px;
    }

    /* Sidebar-urile de 260px (.bg42 / td width="260") — pe tabletă le micșorăm */
    .bg42 {
        width: 220px;
    }
    td[width="260"] {
        width: 220px !important;
    }
    td[width="260"] .bg42 {
        width: 100%;
    }

    /* Header de pagină (.bg26) — celule rearanjabile dacă logo + titlu + meniu
       devin prea înghesuite. Lăsăm tabela să-și recalculeze. */
    .bg19 {
        margin: 0 8px;
    }
    .bg18 {
        height: auto;
        padding: 5px 10px;
    }

    /* Bara de meniu superior (.bg18) — cei 160px pentru search devin flexibili */
    .bg18 td[width="160"] {
        width: 130px !important;
    }

    /* Search input mai îngust dar funcțional */
    .bg24 {
        width: 110px;
        margin: 8px 6px 0 0;
    }
    .editbox_search {
        width: 80px;
    }

    /* Iconițele topnav (rss/sitemap/contact/home/lang) — pe tabletă le păstrăm
       dar reducem marginile între ele */
    .bg11_1, .bg11_2, .bg11_3, .bg11_4 {
        margin-left: 4px;
    }


}



@media screen and (max-width: 900px) {


    div#content {
        padding: 0  20px 0  20px;
    }

    .bg13 > .bg41 > table,
    .bg13 > .bg41 > table > tbody,
    .bg13 > .bg41 > table > tbody > tr,
    .bg13 > .bg41 > table > tbody > tr > td {
        display: block;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box;
    }

    /* Tabelul-rădăcină de pe pagina principală (cel direct sub #content) */
    div#content > table,
    div#content > table > tbody,
    div#content > table > tbody > tr,
    div#content > table > tbody > tr > td {
        display: block;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box;
    }

    /* Sidebar.bg42: pe acest layout devine 100% și obține o margine jos */
    .bg42 {
        width: 100% !important;
        margin-bottom: 16px;
    }

    /* Tabelul intern din .bg43 (conținut + sidebar dreapta) */
    .bg43 > table,
    .bg43 > table > tbody,
    .bg43 > table > tbody > tr,
    .bg43 > table > tbody > tr > td {
        display: block;
        width: 100% !important;
        height: auto !important;
        box-sizing: border-box;
    }

    /* Pe pagina lib (cu calendar/luni): tabelul de articole 2-coloane → 1-col */
    .bg43 table[width="100%"] td[width="48%"] {
        display: block;
        width: 100% !important;
        padding-right: 0 !important;
        margin-bottom: 20px;
    }

    /* Header-ul pe pagina principală (.bg26 cu logo + titlu + iconițe) — celulele
       devin block ca să apară logo deasupra titlului iar iconițele dedesubt. */
    .bg26 > table,
    .bg26 > table > tbody,
    .bg26 > table > tbody > tr,
    .bg26 > table > tbody > tr > td {
        display: block;
        width: auto !important;
        height: auto !important;
        text-align: left;
    }
    .bg26 td[width="255"] {
        width: 100% !important;
        padding-top: 8px;
    }
    .bg27 {
        padding: 0;
    }
    .bg28 {
        text-align: left;
    }

    /* Footer table (.bg22 — adresă + telefoane) */
    .bg22 > table,
    .bg22 > table > tbody,
    .bg22 > table > tbody > tr,
    .bg22 > table > tbody > tr > td {
        display: block;
        width: 100% !important;
        text-align: center !important;
        padding: 4px 0;
    }
    .bg50 > table,
    .bg50 > table > tbody,
    .bg50 > table > tbody > tr,
    .bg50 > table > tbody > tr > td {
        display: block;
        width: 100% !important;
        text-align: center !important;
        padding: 4px 0;
        white-space: normal !important;
    }
    .bg50 td[nowrap] {
        white-space: normal !important;
    }
}



@media screen and (max-width: 768px) {

    .indentmenu ul {
       background: none !important;
    }

    .bg52 table tr td:nth-child(3),
    .bg52 table tr td:nth-child(4)
    {
        display:none;
    }
.blockcontent.style_newslink p img,
.editbox_comment_name
{
    width: 100%;
    height: auto;
}
    /* Spațierea principală mai compactă */
    .bg19    { margin: 0; }
    .bg13    { padding: 10px 8px; }
    .bg18    { padding: 4px 8px; height: auto; }
    .bg31    { margin: 0 8px; }
    .bg26    { padding: 6px 0 0 0; }

    /* Logo + titlu pe mobil */
    .bg26 img[src*="im07.png"],
    .bg26 a > img {
        max-width: 80px;
        height: auto;
    }
    A.bg14:link, A.bg14:active, A.bg14:visited {
        font-size: 22px !important;
        line-height: 1.2;
    }
    .color_new {
        font-size: 14px !important;
    }

    /* Iconițe topnav pe mobil (rss/sitemap/contact/home) — păstrate, dar
       lipite la dreapta într-un singur rând */
    .bg11_1, .bg11_2, .bg11_3, .bg11_4 {
        margin-left: 4px;
    }

    /* Bara meniului orizontal (.bg18) — pe mobil ascundem ul.dropdownmenu și
       afișăm hamburger-ul. Hamburgerul e injectat de footerdown.php. */
    .bg18 ul.dropdownmenu,
    .bg18 ul.dropdownmenu * {
        display: none;
    }
    body.nav-open .bg18 ul.dropdownmenu {
        display: block !important;
        position: absolute;
        z-index: 1000;
        background: #fff;
        border: 1px solid #d0d0d0;
        border-radius: 4px;
        margin: 6px 8px;
        padding: 8px 0;
        left: 0;
        right: 0;
        box-shadow: 0 4px 14px rgba(0,0,0,.12);
    }
    body.nav-open .bg18 ul.dropdownmenu li {
        display: block !important;
        list-style: none;
        padding: 8px 14px;
        border-bottom: 1px solid #ececec;
    }
    body.nav-open .bg18 ul.dropdownmenu li:last-child { border-bottom: none; }
    body.nav-open .bg18 ul.dropdownmenu li a {
        display: block !important;
        text-decoration: none;
        font: bold 14px Arial, Helvetica, sans-serif;
        color: #1c5dbe;
    }

    /* Meniul stânga (treemenu — table#dtree_0tbl) — pe mobil îl ascundem
       implicit și-l comutăm prin .nav-open */
    table#dtree_0tbl {
        display: none;
    }
    body.nav-open table#dtree_0tbl {
        display: table;
        width: 100%;
        background: #fafafa;
        border: 1px solid #e3e3e3;
        border-radius: 4px;
    }

    /* Hamburger button injectat — stilul */
    .resp-mobile-toggle {
        display: block;
        background: #1c5dbe;
        color: #fff;
        border: 0;
        border-radius: 0px;
        padding: 12px;
        font: bold 22px Arial, Helvetica, sans-serif;
        cursor: pointer;
        margin: 10px 0px;
        line-height: 1;
        -webkit-appearance: none;
        width: 100%;
    }
    .resp-mobile-toggle:hover,
    .resp-mobile-toggle:focus {
        background: #154a99;
        outline: none;
    }
    .resp-mobile-toggle::before {
        content: "\2261";       /* ≡ trigram for heaven = hamburger */
        font-size: 26px;
        margin-right: 6px;
        vertical-align: 0px;
    }
    body.nav-open .resp-mobile-toggle::before {
        content: "\2715";       /* ✕ */
        font-size: 16px;
    }

    /* Search-ul din header devine full-width sub iconițe */
    .bg18 td[width="160"] {
        display: block;
        width: 100% !important;
        padding-top: 6px;
    }
    .bg24 {
        width: auto;
        max-width: 100%;
        float: none;
        margin: 0 0 6px 0;
        box-sizing: border-box;
    }
    .bg24 .bg20 {
        width: calc(100% - 40px);
    }
    .editbox_search {
        width: 100%;
        color: #fff;
    }

    /* Bara meniu sus celulele <td> deja făcute block prin secțiunea ≤900px;
       aici doar ne asigurăm că tabela respectivă (.bg18 > table) e și ea block */
    .bg18 > table,
    .bg18 > table > tbody,
    .bg18 > table > tbody > tr,
    .bg18 > table > tbody > tr > td {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
    }

    /* Slider-ul de pe pagina principală — mai jos pe mobil, păstrând aspectul */
    .bg281,
    .bg291 {
        height: auto !important;
    }
    .bg291 {
        background-size: cover !important;
        min-height: 320px;
    }
    .bg301 {
        position: static !important;
        font-size: 14px;
        line-height: 18px;
        padding: 8px 10px;
    }
    .bg301 a:link, .bg301 a:active, .bg301 a:visited,
    .bg301 a:hover {
        font-size: 14px;
    }

    /* Suggestion (search) box pe mobil */
    .suggest {
        width: auto !important;
        max-width: calc(100vw - 16px) !important;
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
    }

    /* Footer pe mobil */
    .bg22 { margin: 0; padding: 8px 10px; }
    .bg50 { padding: 6px 10px; }
    .style_address_footer,
    .style_tel_text,
    .style_visits_title,
    .style_visits_text,
    .style_copyright_footer {

        line-height: 18px !important;
        white-space: normal !important;
    }
    .style_copyright_footer { display: block; }
    .style_visits_title b,
    .style_visits_text b { font-size: 12px !important; }

    /* Bg-uri decorative de title (.bg52) compactăm marginea */
    .bg52  { padding: 4px 0 6px 0; margin-bottom: 8px; }
    .bg51  { padding: 0 0 6px 0; }
    .bg53  { margin: 8px 0 12px 0; }

    /* Titluri mai mici pe mobil */
    .style_annonce_title    { font-size: 18px; line-height: 22px; }
    .style_annonce_title h1 { font-size: 20px; }

    /* Tabele uzuale din conținut (din articole publicate) — let them scroll
       horizontal când conținutul nu încape, fără să strivim coloanele */
    .style_block_text table,
    .bg43 .style_block_text table {
        max-width: 100%;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #dtree_0div
    {
        width: 90% !important;
        margin: 0px 10px !important;

    }
    #dtree_0div table tr td span
    {
        padding-left: 15px;
    }
    table#dtree_0tbl tr
    {
        border: none !important;
    }
    #dm0m0tbl tr td, #dm0m0tbl tr
    {
        width: 100%;
        display: block; text-align: center;
    }
    .submenu
    {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .topItemNormal
    {
        /*background: none !important;
        text-align: center;

        width: 100%;

        display: flex;
        justify-content: center;
        align-items: center;
*/
    }

    .bg27 {
        padding: 0;
        width: 100%;
        display: flex;
        margin-bottom: 20px;
        align-items: center;
        align-content: center;
        justify-content: center;
    }
    .bg18{
        background: none !important;
    }

    .topmenu-a table tr td
    {
        text-align: center !important;
    }

    .topmenu-a table tr td
    {
        display: block;
        width: 100%;
    }

    .bg13 { padding: 8px 6px; }

    A.bg14:link, A.bg14:active, A.bg14:visited {
        font-size:26px !important;
    }
    .bg26 img[src*="im07.png"], .bg26 a > img {
        max-width: 115px;
        height: auto;
    }
    .bg28 .style_last_update
    {
        display: none;
    }
    .color_new { font-size: 12px !important; }

    /* Stilul fontului foarte mare din site */
    .bg55 { font-size: 28px !important; line-height: 30px !important; }

    .newscontent table tr td
    {
        display: block;
        width: 100%;
    }
    .bg22 {
        background: #f1f1f1;
        margin: 0 10px;
        padding: 5px 28px;
    }
    img {
        max-width: 100%;
        height: auto;
    }
    .sliderwrapper .contentdiv
    {
        width: 100%;
        height: auto;
    }
    .sliderwrapper {
        height: 330px;

    }

    #main .sp-pub table.sp-ptable thead th
    {
        display: block;
        width: 100%;
        background: none;
 
        border:none;
    }

}
@media screen and (max-width: 576px)
{
    .sliderwrapper {
        height: 200px;

    }

    .bg291 {
        background-size: cover !important;
        min-height: 180px;
    }

}
