/* ================= BODY & FONT ================= */
body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background: #f4f4f5;
    color: #2c2c2c;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* ================= HEADER ================= */
header {
    background: linear-gradient(90deg, #ffffff, #f9f9f9);
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

header .logo {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #d10000;
    cursor: pointer;
}

header .cart-button {
    position: relative;
    background: #d10000;
    color: #fff;
    padding: 10px 20px;
    border-radius: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

header .cart-button:hover {
    background: #a30000;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

header .cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff4d4d;
    color: white;
    font-size: 0.75em;
    padding: 4px 7px;
    border-radius: 50%;
    font-weight: bold;
    min-width: 22px;
    text-align: center;
}

/* ================= MAIN ================= */
main {
    flex: 1;
	min-width:900px;
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px 50px;
}

/* ================= SEARCH FORM ================= */
.search-form {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 20px auto;
}

.search-form input[type="text"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-form input[type="text"]:focus {
    border-color: #d10000;
    box-shadow: 0 0 8px rgba(209,0,0,0.3);
    outline: none;
}

.search-form button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #d10000, #ff4d4d);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background: linear-gradient(135deg, #a30000, #e60000);
    box-shadow: 0 4px 12px rgba(209,0,0,0.3);
}

/* ================= FILTERS / SORT ================= */
.filters-sort {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.filters-sort label {
    font-weight: 600;
    margin-right: 10px;
    color: #333;
}

.filters-sort select {
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 0.95em;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.filters-sort select:focus {
    outline: none;
    border-color: #d10000;
    box-shadow: 0 0 6px rgba(209,0,0,0.3);
}

.products-count {
    font-weight: 500;
    color: #555;
    margin-top: 8px;
}

/* ================= PRODUCT GRID ================= */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    padding: 20px 0;
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= PRODUCT CARD ================= */
.product-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: #2c2c2c;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

.product-card img {
    width: auto;
    max-width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    display: block;
    margin: 0 auto;
    background: #fff;
}

.product-name {
    font-weight: 600;
    font-size: 1.15em;
    margin: 15px 10px 5px;
}

.product-price {
    color: #d10000;
    font-weight: 700;
    font-size: 1.2em;
    margin: 0 10px 15px;
}

/* ================= PAGINATION ================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #2c2c2c;
    border: 1px solid #ccc;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination a:hover {
    background-color: #f0f0f0;
    border-color: #d10000;
    color: #d10000;
}

.pagination .current-page {
    background-color: #d10000;
    color: white;
    border-color: #d10000;
}

/* ================= PRODUCT DETAILS ================= */
.product-details {
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

.product-images img {
    max-width: 500px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	display:block;
	margin-bottom:24px;
}

.product-info {
    flex: 1;
    min-width: 320px;
}

.product-info h2 {
    font-size: 2em;
    margin-top: 0;
}

.product-info .price {
    font-size: 1.6em;
    color: #d10000;
    font-weight: 700;
    margin: 15px 0;
}

/* ================= BUTTONS ================= */
.add-to-cart-form button {
    background: linear-gradient(135deg, #d10000, #ff4d4d);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 6px 15px rgba(209,0,0,0.25);
    transition: all 0.3s ease;
}

.add-to-cart-form button:hover {
    background: linear-gradient(135deg, #a30000, #e60000);
}

/* ================= INPUT NUMBER ================= */
input[type="number"] {
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 1em;
    width: 80px;
    text-align: center;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="number"]:focus {
    border-color: #d10000;
    box-shadow: 0 0 8px rgba(209,0,0,0.25);
    outline: none;
}

/* ================= TABLES ================= */
table {
    border-collapse: collapse;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

th, td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f7f7f7;
    font-weight: 600;
    color: #333;
}

tr:nth-child(even) {
    background-color: #fcfcfc;
}

tr:hover {
    background-color: #f5f5f5;
}

/* ================= FOOTER ================= */
footer {
    background: #fff;
    border-top: 1px solid #eee;
    padding: 25px 40px;
    text-align: center;
    color: #666;
    font-size: 0.95em;
}

/* ================= TOTAL PRICE BOX ================= */
.total {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 15px;
    padding: 20px 25px;
    margin: 25px 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    text-align: right;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ================= FINALIZATION BUTTON ================= */
.finalize-btn {
    background: linear-gradient(135deg, #d10000, #ff4d4d);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1em;
    box-shadow: 0 6px 15px rgba(209,0,0,0.25);
    transition: all 0.3s ease;
}

.finalize-btn:hover {
    background: linear-gradient(135deg, #a30000, #e60000);
    transform: translateY(-2px);
}

/* ================= CHANGE BUTTON ================= */
button[name="update"] {
    background: #f0f0f0;
    color: #333;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

button[name="update"]:hover {
    background: #e6e6e6;
    border-color: #999;
    color: #000;
}

/* ================= RESPONSYWNOŚĆ OGÓLNA ================= */
@media (max-width: 1024px) {
    .product-details {
        flex-direction: column;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    .filters-sort {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .products-count {
        margin-top: 5px;
    }
}

/* ================= FORMULARZE ================= */
form label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #333;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="number"],
form input[type="password"],
form input[type="search"],
form select,
form textarea {
    width: 80%;
    padding: 12px 16px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #fff;
    color: #2c2c2c;
	margin-bottom: 20px;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #d10000;
    box-shadow: 0 0 8px rgba(209,0,0,0.25);
    outline: none;
}

form input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    accent-color: #d10000;
    cursor: pointer;
}

form button,
form .finalize-btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #d10000, #ff4d4d);
    color: #fff;
    font-weight: 600;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(209,0,0,0.25);
}

form button:hover,
form .finalize-btn:hover {
    background: linear-gradient(135deg, #a30000, #e60000);
    transform: translateY(-2px);
}

/* Pola wysyłki / faktury */
#companyFields,
#privateFields,
#shippingFields {
    background: #fff;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Checkbox inline label */
form label input[type="checkbox"] {
    vertical-align: middle;
}


/* ================= SIDEBAR ================= */
.sidebar {
    width: 260px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    max-height: 85vh;
    overflow-y: auto;
    float: left;
    margin-right: 30px;
}

.sidebar h3 {
    margin-top: 0;
    color: #d10000;
    font-size: 18px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.sidebar li {
    margin: 4px 0;
}

.sidebar a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
}

.sidebar a:hover {
    color: #d10000;
    font-weight: bold;
}

.toggle {
    cursor: pointer;
    color: #d10000;
    font-weight: bold;
    margin-right: 4px;
    user-select: none;
}

/* ================= CONTENT ================= */
.content {
    flex: 1;
    min-width: 300px;
}

/* ================= VEHICLE SEARCH ================= */
.vehicle-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 25px;
}

.vehicle-search select,
.vehicle-search input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    min-width: 120px;
}

.vehicle-search button {
    background: #d10000;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.vehicle-search button:hover {
    background: #a30000;
}

#vehicleResults {
    margin: 10px auto 30px;
    max-width: 900px;
}

#vehicleResults div {
    border: 1px solid #ddd;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 6px;
    background: #fff;
}

/* ================= SHOW ALL BUTTON ================= */
.show-all-btn {
    display: block;
    max-width: 220px;
    margin: 40px auto;
    background-color: #d10000;
    color: #fff;
    font-weight: bold;
    padding: 14px 24px;
    border-radius: 30px;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease;
}

.show-all-btn:hover {
    background-color: #a30000;
}

/* ===== MAIN LAYOUT ===== */
.main-container {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

/* Dla mniejszych ekranów (np. telefonów) – sidebar schodzi pod spód */
@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        max-height: none;
        margin-bottom: 20px;
    }
    .content {
        width: 100%;
    }
}

.selected-car-box {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  text-align: center;
  max-width: 600px;
  margin: 20px auto;
}
.selected-car-box button {
  margin-top: 12px;
  background: #d10000;
  color: white;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.selected-car-box button:hover {
  background: #a30000;
}
.vehicle-link {
  display: block;
  padding: 8px 10px;
  margin: 4px 0;
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: #333;
  border: 1px solid #ddd;
  transition: 0.3s;
}
.vehicle-link:hover {
  background: #f8f8f8;
  color: #d10000;
  border-color: #d10000;
}





















/* ================= VEHICLE MAKES ================= */
.vehicle-makes-section {
  background: #fff;
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  text-align: center;
  margin-bottom: 40px;
}

.makes-title {
  color: #d10000;
  font-weight: 700;
  margin-bottom: 25px;
}

/* Widok kompaktowy (stóg kart/logotypów) */
.makes-collapsed {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
}

.makes-collapsed img {
  width: 60px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  transform: rotate(var(--angle, 0deg));
}

.makes-collapsed img:hover {
  transform: scale(1.2);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.see-all-btn {
  background: #d10000;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95em;
  transition: all 0.3s ease;
  margin-left: 10px;
}
.see-all-btn:hover {
  background: #a30000;
}

/* Widok pełny */
.makes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 18px;
  justify-content: center;
  margin-top: 20px;
}

.make-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 15px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.make-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.1);
  border-color: #d10000;
}
.make-card img {
  width: 100%;
  height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
}
.make-card span {
  font-weight: 600;
  font-size: 0.95em;
}

/* Modele */
.models-container {
  margin-top: 20px;
}
.models-container h3 {
  color: #d10000;
  font-weight: 700;
}
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}
.model-item {
  display: block;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: all 0.3s ease;
}
.model-item:hover {
  background: #f9f9f9;
  border-color: #d10000;
  color: #d10000;
}
.back-to-makes {
  background: #d10000;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}
.back-to-makes:hover {
  background: #a30000;
}
