/* Wrapper centrowany */
.agrimpex-table-wrapper {
    max-width: 1200px;
    margin: 0 auto 10px auto;
    padding: 15px 20px;
    background-color: #e8f3fd;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Nowoczesna tabela z flat design */
.agrimpex-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Górny pasek nagłówka */
.agrimpex-table thead {
    color: #ffffff;
}

.agrimpex-table thead th {
    padding: 14px 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.agrimpex-table thead th:last-child {
    border-right: none;
}

/* Wiersze danych */
.agrimpex-table tbody tr {
    transition: background 0.3s ease;
}

.agrimpex-table tbody tr:nth-child(even) {
    background-color: #f4f7fa;
}

.agrimpex-table tbody tr:hover {
    background-color: #e8f1f7;
}

/* Komórki danych */
.agrimpex-table tbody td {
    padding: 6px 10px;
    text-align: center;
    font-size: 13px;
    color: #333333;
    border-top: 1px solid #e0e0e0;
}

/* Pierwsza kolumna - ID */
.agrimpex-table tbody td:first-child {
    font-weight: bold;
    color: #0088cc;
}

/* Kolumna Cena brutto - akcent kolorystyczny */
.agrimpex-table tbody td:nth-child(11),
.agrimpex-table tbody td:nth-child(12) {
    font-weight: 600;
    color: #009944;
}

/* Kod EAN - mniejsza czcionka */
.agrimpex-table tbody td:nth-child(12) {
    font-size: 12px;
    color: #555;
}

/* Nagłówek H2 */
.agrimpex-table-wrapper h2 {
    text-align: left;
    font-size: 26px;
    font-weight: 700;
    color: #222222;
    margin-bottom: 20px;
    border-left: 6px solid #0088cc;
    padding-left: 12px;
}

/* rozwijanie tabeli */
.agrimpex-toggle-table {
    background: none;
    border: none;
    font-size: 18px;
    margin-left: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    color: #0088cc;
}

.agrimpex-toggle-table:hover {
    color: #005f8d;
}


/* Flexbox dla rozwijanych danych */
.agrimpex-details-flex {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
    text-align: left;
    padding: 0 20px;
    background-color: #f9fbfd;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.agrimpex-details-left {
    width: 80%;
    font-size: 14px;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.agrimpex-details-left p {
    margin: 6px 0;
}

.agrimpex-details-thumb {
    width:20%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agrimpex-details-thumb img {
    max-height: auto;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}


/* Gdy brak miniaturki, lewa strona się nie zmienia */
.agrimpex-details-thumb:empty {
    display: none;
}
/* płynne rozwijanie/zwijanie details */
/* Płynne rozwijanie/zamykanie kontenera w wierszu */

.agrimpex-details-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

/* Gdy aktywne – rozwinięcie */
.agrimpex-details-row.show .agrimpex-details-wrapper {
    max-height: 1000px; /* Możesz zwiększyć, jeśli treści więcej */
}

.agrimpex-details-inner {
    padding: 20px 0;
}


/* Wymaga dodatkowego kontenera wewnątrz do animacji */
.agrimpex-details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.agrimpex-details-row.show .agrimpex-details-content {
    max-height: 1000px; /* odpowiednio duża wartość */
}


/* Responsywność dla tabletów i telefonów */
@media (max-width: 768px) {
    .agrimpex-table thead th,
    .agrimpex-table tbody td {
        font-size: 11px;
        padding: 8px 6px;
    }

    .agrimpex-table-wrapper h2 {
        font-size: 20px;
        padding-left: 8px;
    }

    

    .agrimpex-details-thumb {
        text-align: center;
        margin-top: 10px;
    }
}

/* modalne formularze */
.agrimpex-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.agrimpex-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
}

.agrimpex-modal-content h3 {
    margin-top: 0;
    font-size: 20px;
    color: #222;
}

.agrimpex-modal-content label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
}

.agrimpex-modal-content input[type="text"],
.agrimpex-modal-content input[type="number"],
.agrimpex-modal-content input[type="url"],
.agrimpex-modal-content input[type="file"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.agrimpex-modal-content button[type="submit"] {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 12px 0;
    background-color: #0088cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.agrimpex-modal-content button[type="submit"]:hover {
    background-color: #0070aa;
}

.agrimpex-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.agrimpex-modal-close:hover {
    color: #333;
}
.agrimpex-modal {
    display: none;
}

.agrimpex-modal.show {
    display: flex;
}

/* style dla ikonek akcji */
/* Stylowanie przycisków w kolumnie Akcje */
.agrimpex-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.agrimpex-actions button {
    background: none;
    border: none;
    padding: 4px;
    margin: 0;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.agrimpex-actions button:hover {
    background-color: rgba(0, 136, 204, 0.1);
}
/* EAN css */
.ean-barcode-wrapper {
    margin-top: 10px;
    width: 130px;
    text-align: left;
}

.ean-barcode {
    width: 120px;
    height: auto;
    display: block;
    margin: 5px 0;
}

.ean-number {
    font-size: 12px;
    margin-top: 2px;
    color: #333;
    text-align: center;
}

/* style przycisku Import CSV */
.agrimpex-import-wrapper {
    background: #f1f1f1;
    border: 1px solid #ccc;
    padding: 20px;
    margin: 30px auto;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
	display: flex;
	justify-content: space-between;
	white-space: nowrap;
}

.agrimpex-import-wrapper h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.agrimpex-import-wrapper form {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    align-items: center;
}

.agrimpex-import-wrapper input[type="file"] {
    flex: 1 1 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.agrimpex-import-wrapper button[type="submit"] {
    background-color: #0073aa;
    color: white;
    padding: 10px 20px;
    font-size: 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
	white-space: nowrap;
}

.agrimpex-import-wrapper button[type="submit"]:hover {
    background-color: #005f8d;
}

@media (max-width: 1024px) {
    .agrimpex-table-wrapper {
        padding: 20px 10px;
    }

    .agrimpex-table {
        font-size: 12px;
    }
.agrimpex-table td:nth-child(1) { width: 120px; }
.agrimpex-table td:nth-child(2) { width: 120px; }


    .agrimpex-table-wrapper h2 {
        font-size: 22px;
    }

    .agrimpex-table thead th {
        font-size: 12px;
        padding: 10px 8px;
    }

    .agrimpex-table tbody td {
        font-size: 12px;
        padding: 10px 6px;
    }
}
@media (max-width: 768px) {
	.agrimpex-import-wrapper {
    padding: 8px;
    margin: 15px auto;
    border-radius: 8px;
}
	.agrimpex-import-wrapper form {
    gap: 5px;
}
	.agrimpex-import-wrapper button[type="submit"] {
    padding: 8px 18px;
    font-size: 12px;
}
	.agrimpex-import-wrapper h3 {
    margin-bottom: 6px;
    font-size: 16px;
}
   .agrimpex-import-wrapper {
	display: flex;
	flex-direction: column;
}
	.agrimpex-import-wrapper form {
    flex-wrap: wrap;
}
	.agrimpex-table-wrapper {
        padding: 15px 5px;
    }
    .agrimpex-table-wrapper h2 {
        font-size: 16px;
    }
	.agrimpex-toggle-table {
    font-size: 16px;
}
.agrimpex-table {
    display: table;
    table-layout: auto; /* zmiana z fixed na auto */
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .agrimpex-table th,
  .agrimpex-table td {
    white-space: nowrap;
    overflow-wrap: normal;
    min-width: auto; /* zmiana z 600px na auto */
    max-width: 100%;
    word-break: keep-all;
    text-overflow: ellipsis;
  }

    .agrimpex-details-flex {
		text-align: left;
        gap: 15px;
    }

        
     
    
    .agrimpex-details-left {
        width: 60%;
    }

    .agrimpex-details-thumb {
        width: 100%;
        justify-content: left;
    }

    .agrimpex-details-thumb img {
        max-width: 100%;
    }

    .agrimpex-actions button {
        font-size: 14px;
    }

    .agrimpex-modal-content {
        max-width: 95%;
    }
}

.agrimpex-table-scroll {
	display: none;
    overflow-x: auto;
	overflow-y: auto; /* <-- dodaj to */
    position: relative; /* <-- to umożliwia sticky */
    width: 100%;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .agrimpex-table-scroll {
    max-height: 400px;
    overflow-y: auto;
    position: relative;
  }

  .agrimpex-table thead th {
    position: sticky;
    top: 0;
    background-color: #0088cc !important;
    color: #fff;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
}



.agrimpex-table {
    min-width: 700px; /* lub więcej, jeśli potrzebujesz większej przestrzeni */
}
