/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.875vw;
    line-height: 1.4;
    color: #333;
    background-color: #c6c6c6;
}

/* Header styles - ZMODYFIKOWANE */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55vw 1.25vw;
    background: rgb(49, 49, 49);
    color: white;
    box-shadow: 0 0.125vw 0.875vw rgba(0,0,0,0.1);
    border-radius: 0 0 1vw 1vw;
    gap: 20px;
}

.main-header h1 {
    font-size: 1.375vw;
    font-weight: 600;
    letter-spacing: 0.0625vw;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.9375vw;
    flex-wrap: wrap;
}

.user-name {
    color: #f1c40f;
    font-weight: 600;
    padding: 0.5vw 0.875vw;
    white-space: nowrap;
    font-size: 0.875vw;
}

.header-link {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5vw 0.875vw;
    border-radius: 0.3125vw;
    background: #555;
    white-space: nowrap;
}

/* Nowe style dla wyszukiwarki w jednej linii */
.search-container {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 50%;
    min-width: 300px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 600px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 0.375vw 0.75vw;
    border: 0.0625vw solid #ddd;
    border-radius: 0.25vw;
    font-size: 0.875vw;
    min-width: 150px;
}

.search-buttons {
    display: flex;
    gap: 5px;
}

.search-buttons button {
    padding: 0.375vw 0.75vw;
    border: none;
    border-radius: 0.25vw;
    cursor: pointer;
    font-size: 0.875vw;
    white-space: nowrap;
}

/* Reszta stylów pozostaje BEZ ZMIAN */
/* Reszta stylów pozostaje BEZ ZMIAN */

.header-link:hover {
    color: #1e1e1e;
    background: rgb(241, 196, 15);
}

/* Nowe style dla wyśrodkowanej wyszukiwarki */
.controls-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 558px;
    width: 100%;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 0.375vw 0.75vw;
    border: 0.0625vw solid #ddd;
    border-radius: 0.25vw;
    font-size: 0.875vw;
    min-width: 200px;
}

.search-buttons {
    display: flex;
    gap: 5px;
}

.search-buttons button {
    padding: 0.375vw 0.75vw;
    border: none;
    border-radius: 0.25vw;
    cursor: pointer;
    font-size: 0.875vw;
    white-space: nowrap;
}

.search-btn {
    background-color: #4CAF50;
    color: white;
}

.clear-btn {
    background-color: #f44336;
    color: white;
}

.clear-btn:hover {
    background: #f1c40f;
    color: black;
}

.advanced-btn {
    background-color: #939393;
    color: white;
}

.advanced-btn:hover {
    background: #f1c40f;
    color: black;
}

/* Reszta stylów pozostaje BEZ ZMIAN */

/* Main container */
.container-main {
    width: 66.25vw;
    max-width: 66.25vw;
    margin-left: calc((100% - 66.25vw) / 2);
    margin-right: calc((100% - 66.25vw) / 2);
    padding: 0 0.1375vw 0.1375vw;
    margin-top: 32px;
    flex-shrink: 0;
    position: relative;
}

/* Product list section */
.ads-list-section {
    background: #d7d7d7;
    border-radius: 0.375vw;
    box-shadow: 0 0.0625vw 0.1875vw rgba(0,0,0,0.1);
    padding: 0.9375vw;
    margin: 10px;
    margin-top: 12px;
    min-height: 658px;
    position: relative;
}

/* Ad banners */
.ad-banner {
    position: fixed;
    top: 3.7375vw;
    z-index: 101;
    width: calc((100% - 66.25vw - 10px) / 2);
    max-width: 500px;
    min-width: 40px;
    display: flex;
    flex-direction: column;
    gap: 0.01vw;
    transition: all 0.3s ease;
}

.ad-banner.left {
    left: 5px;
    margin-top: 10px;
}

.ad-banner.right {
    right: 5px;
    margin-top: 10px;
}

.banner-module {
    width: 100%;
    aspect-ratio: 16/10;
    margin-bottom: 0.625vw;
    border-radius: 0.25vw;
    overflow: hidden;
    box-shadow: 0 0.125vw 0.625vw rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center center;
}

.banner-module:hover {
    transform: scale(1.7);
    z-index: 102;
    box-shadow: 0 0.5vw 1.5vw rgba(0,0,0,0.3);
}

.ad-banner.left .banner-module:hover {
    transform: scale(1.32) translateX(12%);
}

.ad-banner.right .banner-module:hover {
    transform: scale(1.2) translateX(-8%);
}

.banner-module img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-module.empty {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    text-align: center;
    padding: 10px;
}

/* Link reklamowy pod banerami po lewej */
.advertise-link-container {
    width: 100%;
    margin-top: 0.5vw;
    margin-bottom: 0.5vw;
    flex-shrink: 0;
    min-height: fit-content;
}

.advertise-link-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5vw;
    padding: 0.75vw 1vw;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 0.375vw;
    font-size: 0.875vw;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 0.125vw 0.5vw rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.advertise-link-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25vw 0.75vw rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.advertise-link-banner svg {
    width: 1.125vw;
    height: 1.125vw;
    flex-shrink: 0;
}
    color: #666;
    text-align: center;
    padding: 10px;
}

/* Sort and view controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.sort-controls .sort-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-controls select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    height: 36px;
    font-size: 0.875vw;
}

.sort-controls button {
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sort-controls button:hover {
    background: #e9e9e9;
}

.sort-controls button.active {
    background: rgb(241, 196, 15);
    border-color: rgb(241, 196, 15);
}

.sort-label {
    font-weight: 500;
    color: #555;
}

.view-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 15px;
    padding: 0 10px;
    gap: 15px;
}

.view-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.view-btn {
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #e9e9e9;
}

.view-btn.active {
    background: rgb(241, 196, 15);
    border-color: rgb(241, 196, 15);
}

/* Controls row */
.perpage-form {
    display: flex;
    align-items: center;
    gap: 0.375vw;
}

.perpage-form select {
    padding: 0.25vw 0.625vw;
    border: 0.0625vw solid #bbb;
    border-radius: 0.3125vw;
    font-size: 0.875vw;
    height: 36px;
}

/* Buttons */
.header-btn {
    display: inline-block;
    background: rgb(91, 90, 90);
    color: #fff !important;
    font-weight: 550;
    padding: 0.5vw 1.25vw;
    border-radius: 0.4375vw;
    text-decoration: none;
    transition: background 0.15s;
    box-shadow: 0 0.125vw 0.4375vw rgba(0,123,255,0.07);
    white-space: nowrap;
}

.header-btn:hover {
    background: #f1c40f;
    color: black;
}

.header-btn.btn-logout {
    background: rgb(91, 90, 90);
}

.header-btn.btn-logout:hover {
    background: #f1c40f;
    color: black;
}

/* Product grid */
.products-container {
    display: grid;
    gap: 0.75vw;
}

.products-container.grid {
    grid-template-columns: repeat(5, 1fr);
}

.products-container.grid.compact {
    gap: 0.6vw;
    row-gap: 1.5vw;
}

.products-container.grid.spacious {
    gap: 0.9375vw;
}

/* Product card */
.product-card {
    border-radius: 0.283vw;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
}

.product-card:hover {
    transform: translateY(-0.7125vw);
    box-shadow: 0 0.2131875vw 0.2175vw rgba(0,0,0,0.1);
    transform: scale(1.061232) translateX(0%);
    z-index: 10;
}

/* Product image container */
.product-image-container {
    aspect-ratio: 16/9;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-image {
    color: #666;
    font-size: 0.8vw;
}

.product-info {
    padding: 0.2vw;
}

.product-info h3 {
    font-size: 0.875vw;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 4px;
    color: black;
}

.product-specs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.3vw;
}

.product-specs .specs-left {
    display: flex;
    align-items: center;
    gap: 0.2vw;
}

.product-price-inline {
    font-weight: 600;
    color: #444;
    margin-left: auto;
}

.product-stats {
    display: none;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.1875vw;
}

.price {
    color: #444;
    font-weight: 600;
}

.slab-price {
    color: #484848;
    font-size: 0.8vw;
}

.price-negotiable {
    color: #550707;
    font-style: italic;
    font-size: 0.8vw;
}

.dimensions {
    color: #4f4f4f;
    font-size: 0.8vw;
}

/* List view */
.products-container.list {
    display: flex;
    flex-direction: column;
    gap: 0.5vw;
}

.products-container.list .product-card {
    display: flex;
    height: 120px;
}

.products-container.list .product-image-container {
    width: 213px;
    flex-shrink: 0;
    height: 100%;
}

.products-container.list .product-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3125vw;
    margin-top: 0;
}

.pagination a, .pagination .active {
    padding: 0.3125vw 0.625vw;
    border: 0.0625vw solid #ddd;
    border-radius: 0.25vw;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background: rgb(241, 196, 15);
    color: white;
}

.pagination .active {
    background: #555;
    color: white;
}

.pagination-info {
    margin-left: 0.625vw;
    padding: 0.3125vw 0.625vw;
    color: #555;
    font-size: 0.875vw;
    font-weight: 500;
    white-space: nowrap;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    background: #fff;
    margin: 0.5% auto;
    padding: 1.25vw;
    max-width: 90vw;
    width: 100%;
    min-height: 90vh;
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 0.3125vw;
    box-shadow: 0 0.3125vw 0.9375vw rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.0625vw solid #eee;
    padding-bottom: 0.625vw;
    margin-bottom: 0.9375vw;
    background: rgb(83, 83, 83);
    color:#ccc;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title {
    margin-left: 0.9375vw;
    font-size: 1.5em;
    margin-top: 0.53vw;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #fff9f9;
    margin-right: 0.96vw;
    margin-top: 0.5vw;
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
    gap: 1.3vw;
    flex: 1;
    overflow-y: auto;
}

.gallery-container {
    flex: 1.857;
    min-width: 18.75vw;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-left: 0.9375vw;
}

.main-image {
    width: 100%;
    height: 30vw;
    object-fit: contain;
    background: #f5f5f5;
    margin-bottom: 0.625vw;
    cursor: pointer;
    position: relative;
}

.thumbnail-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.3125vw;
    /*! padding-bottom: 0.625vw; */
}

.thumbnail {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    position: relative;
    cursor: pointer;
    border: 0.125vw solid transparent;
}

.thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.active {
    border-color: #4caf50;
}

.product-details {
    flex: 1;
    min-width: 18.75vw;
    color: #2b2b2b;
    max-width: 35%;
}

.detail-row {
    margin-bottom: 0.05vw;
    padding: 0.15vw 0.625vw;
    padding-bottom: 0.2vw;
    border-bottom: 0.0625vw solid #cecece;
}

.detail-row:nth-child(even) {
    background-color: #f8f8f8;
}

.detail-row:nth-child(odd) {
    background-color: #ffffff;
}

.detail-label {
    font-weight: bold;
    color: #313131;
    display: inline-block;
    min-width: 7.5vw;
}

.nav-arrow {
    position: absolute;
    top: calc(30vw / 2);
    transform: translateY(-50%);
    font-size: 2em;
    color: white;
    background: rgba(0,0,0,0.6);
    width: 2.5vw;
    height: 3.8vw;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    border-radius: 0.3vw;
    transition: background 0.3s;
    user-select: none;
    pointer-events: auto;
}

.nav-arrow.prev {
    left: 0.625vw;
}

.nav-arrow.next {
    right: 0.625vw;
}

.nav-arrow:hover {
    background: rgb(225, 197, 75);
}

/* Enlarged image styles */
.enlarged-image-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.enlarged-image-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 10000;
}

.enlarged-image {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
    z-index: 10001;
}

.close-enlarged {
    position: absolute;
    top: -2.5vw;
    right: 0;
    color: white;
    font-size: 2em;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 2.5vw;
    height: 2.5vw;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10002;
}

.enlarged-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2em;
    color: white;
    background: rgba(0,0,0,0.5);
    width: 2.5vw;
    height: 3.75vw;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10003;
    border-radius: 0.25vw;
}

.enlarged-nav-arrow.prev {
    left: 1.25vw;
}

.enlarged-nav-arrow.next {
    right: 1.25vw;
}

.enlarged-nav-arrow:hover {
    background: rgba(0,0,0,0.8);
}

/* Welcome message styles */
.welcome-message {
    text-align: center;
    padding: 10px 20px;
    color: #333;
}

.welcome-message h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #424242;
}

.welcome-message p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.subtitle {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 30px;
}

.search-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #e0e0e0;
}

.search-hint svg {
    flex-shrink: 0;
    color: #7f8c8d;
}

.search-hint p {
    margin: 0;
    font-size: 1rem;
    text-align: left;
}

/* Promo boxes */
.promo-container {
    position: relative;
    width: 100%;
    height: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.promo-box {
    position: absolute;
    padding: 13px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.promo-box:hover {
    transform: scale(1.205) !important;
    z-index: 10;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.promo-large {
    width: 250px;
    height: 100px;
    font-size: 18px;
}

.promo-medium {
    width: 252px;
    height: 84px;
    font-size: 16px;
}

.promo-small {
    width: 181px;
    height: 77px;
    font-size: 14px;
}

/* Position and rotation for each box */
.promo-1 { top: 50px; left: 2%; transform: rotate(-3deg); background-color: #fff8e1; }
.promo-2 { top: 150px; left: 60%; transform: rotate(2deg); background-color: #e8f5e9; }
.promo-3 { top: 250px; left: 10%; transform: rotate(1deg); background-color: #e3f2fd; }
.promo-4 { top: 399px; left: 65%; transform: rotate(-1deg); background-color: #f3e5f5; }
.promo-5 { top: 450px; left: 5%; transform: rotate(3deg); background-color: #e0f7fa; }
.promo-6 { top: 594px; left: 70%; transform: rotate(-2deg); background-color: #fffde7; }
.promo-7 { top: 37px; right: 2%; transform: rotate(4deg); background-color: #fbe9e7; }
.promo-8 { top: 272px; right: 10%; transform: rotate(-3deg); background-color: #e8eaf6; }
.promo-9 { top: 500px; right: 5%; transform: rotate(2deg); background-color: #e0f2f1; }
.promo-10 { top: 200px; left: 30%; transform: rotate(-5deg); background-color: #f1f8e9; }
.promo-11 { top: 400px; left: 35%; transform: rotate(1deg); background-color: #ffebee; }
.promo-12 { top: 600px; left: 40%; transform: rotate(-4deg); background-color: #ede7f6; }
.promo-13 { top: 50px; left: 35%; transform: rotate(5deg); background-color: #e8f5e9; }
.promo-14 { top: 650px; left: 10%; transform: rotate(-2deg); background-color: #fff3e0; }
.promo-15 { top: 700px; right: 15%; transform: rotate(3deg); background-color: #e1f5fe; }

/* Search form */
#advancedSearchModal .modal-content {
    max-width: 600px !important;
    padding: 18px !important;
    min-height: auto !important;
    max-height: 90vh !important;
}

#advancedSearchModal .modal-body {
    gap: 0 !important;
    padding: 0 !important;
}

.advanced-search-form {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px 12px !important;
    margin: 0 !important;
    padding: 0 !important;
}

#advancedSearchModal .form-group {
    margin-bottom: 0 !important;
    padding: 0 !important;
}

#advancedSearchModal .form-group label {
    display: block !important;
    margin-bottom: 4px !important;
    margin-top: 0 !important;
    font-size: 13px !important;
    font-weight: 600;
    color: #444;
    line-height: 1.3 !important;
    padding: 0 !important;
}

#advancedSearchModal .form-control {
    width: 100% !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
    border: 1px solid #c1c1c1;
    border-radius: 4px;
    line-height: 1.4 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: auto !important;
}

#advancedSearchModal select.form-control {
    padding-right: 25px !important;
    padding-left: 10px !important;
    background-size: 12px !important;
}

#advancedSearchModal .range-group {
    display: flex !important;
    gap: 6px !important;
    margin: 0 !important;
}

#advancedSearchModal .range-group input {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
}

#advancedSearchModal .location-fields-row {
    display: flex !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
}

#advancedSearchModal .location-postal-code,
#advancedSearchModal .location-distance {
    flex: 0 0 auto !important;
    width: auto !important;
}

#advancedSearchModal .location-postal-code {
    flex-basis: 120px !important;
}

#advancedSearchModal .location-distance {
    flex-basis: 100px !important;
}

#advancedSearchModal .location-city {
    flex: 1 !important;
    min-width: 0 !important;
}

#advancedSearchModal .form-actions {
    grid-column: 1 / -1 !important;
    display: flex !important;
    gap: 10px !important;
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

#advancedSearchModal .form-actions button {
    flex: 1 !important;
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px !important;
    min-height: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
}

#advancedSearchModal .form-actions .search-btn,
#advancedSearchModal .form-actions .clear-btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    height: auto !important;
    min-height: auto !important;
}

/* Advertiser info */
.advertiser-info {
    display: none;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #eee;
}

.advertiser-info.visible {
    display: block;
}

.show-advertiser-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.show-advertiser-btn:hover {
    background: #e9e9e9;
}

.show-advertiser-btn svg {
    transition: transform 0.3s;
}

.show-advertiser-btn.expanded svg {
    transform: rotate(90deg);
}

.advertiser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.advertiser-header h3 {
    margin: 0;
    padding-right: 15px;
}

.show-all-products-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.show-all-products-btn:hover {
    background-color: #45a049;
}

/* Product stats */
.product-stats {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
}

.product-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-stats .stat-item[data-stat] {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-stats .stat-item svg {
    flex-shrink: 0;
}

.favorite-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn.active svg {
    fill: red;
    stroke: red;
}

.favorite-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #ccc;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.modal-favorite-btn {
    margin-left: auto;
    color: #666;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5vw;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: transform 0.2s ease;
    border-radius: 4px;
}

.favorite-btn-text {
    font-size: 0.9em;
    color: #666;
}

.modal-favorite-btn:hover .favorite-btn-text {
    color: #333;
}

.modal-favorite-btn.active .favorite-btn-text {
    color: #d32f2f;
}

.modal-favorite-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.05);
}

.modal-favorite-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #666;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.modal-favorite-btn:hover svg {
    stroke: red;
}

.modal-favorite-btn.active svg {
    fill: red;
    stroke: red;
}
    transition: fill 0.2s;
}

.favorite-btn.active svg,
.favorite-btn:hover svg {
    fill: red;
}

.product-stats-modal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
    margin-top: 0.0625vw;
    padding: 0.375vw;
    background: #f5f5f5;
    border-radius: 0.3125vw;
    font-size: 0.9em;
    width: 100%;
    justify-content: space-between;
}

.product-stats-modal .stat-item {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5vw;
}

.product-stats-modal .stat-item span {
    color: #666;
}

.product-stats-modal .stat-item strong {
    color: #333;
    font-weight: 600;
}

/* Pagination container */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px 0;
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.pagination-left span {
    margin-right: 10px;
}

.products-count {
    color: #555;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.products-count strong {
    color: #333;
    font-weight: 600;
}

.perpage-form {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* Responsive styles */
@media (max-width: 1600px) {
    .ad-banner {
        max-width: 400px;
    }
}

@media (max-width: 1400px) {
    .ad-banner {
        max-width: 350px;
    }
}

@media (max-width: 1200px) {
    body {
        font-size: 1vw;
    }
    
    .products-container.grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .ad-banner {
        max-width: 300px;
    }
}

@media (max-width: 992px) {
    body {
        font-size: 1.2vw;
    }
    
    .products-container.grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ad-banner {
        display: none;
    }
    
    .advertise-link-container {
        display: none;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 1.5vw;
    }
    
    .main-header {
        flex-direction: column;
        gap: 0.625vw;
        padding: 0.625vw;
    }
    
    .container-main {
        padding-top: 7.5vw;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5vw 0.375vw;
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form input[type="text"] {
        width: 100%;
    }
    
    .products-container.grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-container.list .product-card {
        flex-direction: column;
        height: auto;
    }
    
    .products-container.list .product-image-container {
        width: 100%;
        aspect-ratio: 16/9;
    }
    
    .controls-row {
        margin-right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625vw;
    }

    .view-controls-top {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sort-controls, .view-controls {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 2vw;
    }
    
    .products-container.grid {
        grid-template-columns: 1fr;
    }
    
    .thumbnail-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .thumbnail-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Style dla sekcji ulubionych */
.favorites-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.favorites-header h2 {
    margin: 0;
    color: #333;
}

.back-to-search {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.back-to-search:hover {
    background-color: #e0e0e0;
}

.header-btn.active {
    background-color: #f0c14b;
    color: #111;
    font-weight: bold;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.enlarged-image-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
}

.enlarged-image-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
}

.enlarged-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
    width: auto;
    height: auto;
}

.close-enlarged {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0,0,0,0.7);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10002;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.close-enlarged:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.enlarged-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: white;
    background: rgba(0,0,0,0.7);
    width: 50px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10003;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.enlarged-nav-arrow:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
}

.enlarged-nav-arrow.prev {
    left: 20px;
}

.enlarged-nav-arrow.next {
    right: 20px;
}

/* Background overlay */
.enlarged-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

/* Loading indicator */
.enlarged-image-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    z-index: 10004;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Stylowanie dymka na mapie - szerszy niż wyższy */
.leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
    min-width: 200px;
    max-width: 300px;
    width: auto;
}

.leaflet-popup-content > div {
    padding: 8px 12px;
    line-height: 1.4;
    word-wrap: break-word;
}