#product-selector {
    margin-top: 15px;
}

/* Front page: module/m4pcustomeroffers/offers */
.m4p-offers-page {
    --m4p-card-radius: 14px;
    --m4p-card-border: #eaeaea;
    --m4p-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.m4p-offers-page h1 {
    margin: 0 0 16px 0;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.m4p-offers-page .panel {
    border: 1px solid var(--m4p-card-border);
    border-radius: var(--m4p-card-radius);
    overflow: hidden;
    box-shadow: var(--m4p-shadow);
    background: #fff;
    margin-bottom: 18px;
}

.m4p-offers-page .panel-heading {
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    border-bottom: 1px solid #f0f0f0;
    padding: 14px 16px;
    font-weight: 700;
    color: #222;
}

.m4p-offers-page .panel-body {
    padding: 16px;
}

.m4p-offers-page .form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    display: inline-block;
}

.m4p-offers-page .m4p-form-section {
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
    margin: 14px 0;
}

.m4p-offers-page .m4p-form-section__head {
    margin-bottom: 10px;
}

.m4p-offers-page .m4p-form-section__title {
    font-weight: 800;
    color: #222;
    font-size: 14px;
    margin-bottom: 2px;
}

.m4p-offers-page .m4p-form-section__desc {
    font-size: 12px;
    color: #6b7280;
}

.m4p-offers-page .m4p-logo-preview {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.m4p-offers-page .m4p-logo-preview__img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
}

.m4p-offers-page .m4p-logo-preview__text {
    font-size: 12px;
    color: #666;
}

.m4p-offers-page .form-control {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #d9d9d9;
    box-shadow: none;
    padding: 9px 12px;
}
.m4p-offers-page .form-control:focus {
    border-color: #66afe9;
    box-shadow: 0 0 0 3px rgba(102,175,233,.20);
    outline: 0;
}

input[type="file"] {
    padding-bottom: 37px !important;
}

.m4p-offers-page .btn {
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 700;
}

.m4p-offers-page .btn-primary {
    background: #2e77d0;
    border-color: #2e77d0;
}
.m4p-offers-page .btn-primary:hover {
    background: #2567b7;
    border-color: #2567b7;
}

.m4p-offers-page .btn-success {
    background: #2e9b5a;
    border-color: #2e9b5a;
}
.m4p-offers-page .btn-success:hover {
    background: #26854d;
    border-color: #26854d;
}

.m4p-offers-page .table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.m4p-offers-page .table thead th {
    background: #fafafa;
    border-bottom: 1px solid #eee;
    font-weight: 700;
    color: #333;
    padding: 12px 12px;
}
.m4p-offers-page .table td {
    padding: 12px 12px;
    border-bottom: 1px solid #f2f2f2;
    color: #333;
}
.m4p-offers-page .table tbody tr:hover td {
    background: #f7faff;
}
.m4p-offers-page .table tbody tr:last-child td {
    border-bottom: 0;
}

.m4p-offers-page #products-list {
    margin-top: 12px;
}

.m4p-offers-page #products-list .list-group-item {
    border-radius: 12px;
    border: 1px solid #eee;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,.04);
}

#products-list {
    margin-top: 15px;
}

.products-list .list-group-item {
    margin-bottom: 10px;
}

.attribute-group {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

#images-selector img {
    cursor: pointer;
    transition: all 0.3s;
}

#images-selector img:hover {
    border-color: #337ab7 !important;
    box-shadow: 0 0 5px rgba(51, 122, 183, 0.5);
}

#images-selector input[type="radio"]:checked + img {
    border-color: #337ab7 !important;
    box-shadow: 0 0 10px rgba(51, 122, 183, 0.8);
}

.product-item {
    cursor: pointer;
}

.product-item:hover {
    background-color: #f5f5f5;
}

/* Admin panel styles */
#generate-offer-form .form-group {
    margin-bottom: 20px;
}

/* Back office generator: make it visually match FO layout (stacked fields, same cards) */
.m4p-offers-page--bo {
    --m4p-card-radius: 14px;
    --m4p-card-border: #eaeaea;
    --m4p-shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* Ensure BO panels look like FO cards when wrapped */
.m4p-offers-page--bo .panel {
    border: 1px solid var(--m4p-card-border);
    border-radius: var(--m4p-card-radius);
    overflow: hidden;
    box-shadow: var(--m4p-shadow);
    background: #fff;
    margin-bottom: 18px;
}

.m4p-offers-page--bo .panel-heading {
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
    border-bottom: 1px solid #f0f0f0;
    padding: 14px 16px;
    font-weight: 700;
    color: #222;
}

.m4p-offers-page--bo .panel-body {
    padding: 16px;
}

/* BO-specific width helpers should not constrain the FO-like layout */
.m4p-offers-page--bo .fixed-width-xl {
    width: 100% !important;
    max-width: 100% !important;
}

.m4p-offers-page--bo .help-block {
    font-size: 12px;
    color: #6b7280;
}

/* BO buttons: keep FO spacing/rounded corners */
.m4p-offers-page--bo .btn {
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 700;
}

#generate-offer-form .panel-footer {
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    padding: 15px;
    margin-top: 20px;
}

#products-list {
    margin-top: 15px;
}

#products-list .list-group {
    margin-bottom: 0;
}

#products-list .list-group-item {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    background-color: #fff;
}

#products-list .list-group-item strong {
    color: #333;
    font-size: 14px;
}

#products-list .list-group-item .btn {
    margin-left: 10px;
}

#product-search-results {
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
}

#product-search-results .list-group-item {
    border-left: none;
    border-right: none;
    border-top: none;
    padding: 10px 15px;
}

#product-search-results .list-group-item:first-child {
    border-top: 1px solid #ddd;
}

#product-search-results .list-group-item:last-child {
    border-bottom: none;
}

#product-search-results .list-group-item-heading {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
}

#product-search-results .list-group-item-text {
    margin-bottom: 0;
    font-size: 12px;
    color: #777;
}

#attributes-selector label {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 8px;
    font-weight: normal;
    cursor: pointer;
}

#attributes-selector input[type="checkbox"] {
    margin-right: 5px;
}

/* Color selector (FO + BO product modal) */
#color-selector {
    text-align: left;
}
#color-selector .list-group-item.m4p-color-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
}
#color-selector .list-group-item.m4p-color-item input[type="radio"] {
    margin: 0;
}
#color-selector .m4p-color-thumb {
    width: 37px;
    height: 37px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    overflow: hidden;
    background: #fff;
    flex: 0 0 37px;
}
#color-selector .m4p-color-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Sizes/prices box thumbnail (not inside #color-selector) */
.m4p-color-thumb.m4p-color-thumb--sizes {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    overflow: hidden;
    background: #fff;
    display: inline-block;
}
.m4p-color-thumb.m4p-color-thumb--sizes img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
#color-selector .m4p-color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    background: repeating-linear-gradient(
        45deg,
        #f3f3f3,
        #f3f3f3 4px,
        #ffffff 4px,
        #ffffff 8px
    );
    flex: 0 0 16px;
}
#color-selector .m4p-color-name {
    flex: 1 1 auto;
}

#images-selector .col-md-3 {
    margin-bottom: 15px;
}

#images-selector label {
    display: block;
    cursor: pointer;
    margin-bottom: 0;
}

#images-selector input[type="radio"] {
    display: none;
}

#images-selector input[type="radio"]:checked + img {
    border: 3px solid #337ab7 !important;
    box-shadow: 0 0 10px rgba(51, 122, 183, 0.8);
}

#selected-product-details {
    padding-top: 15px;
}

#selected-product-details h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

/* Combinations selector */
.combinations-list {
    max-height: none;
    overflow-y: visible;
}

.combination-item {
    transition: all 0.3s;
}

.combination-item:hover {
    background-color: #f0f0f0;
    border-color: #337ab7 !important;
}

.combination-item input[type="radio"] {
    margin-right: 10px;
}

.combination-item input[type="radio"]:checked + strong {
    color: #337ab7;
}

.combination-item label {
    margin-bottom: 0;
    font-weight: normal;
}

/* Cart price editor styles */
.m4p-price-editor {
    margin-top: 8px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.m4p-price-editor label {
    font-size: 12px;
    margin: 0;
    white-space: nowrap;
    color: #666;
    font-weight: 600;
}

.m4p-price-editor .m4p-custom-price-input {
    width: 100px;
    display: inline-block;
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.m4p-price-editor .m4p-custom-price-input:focus {
    border-color: #66afe9;
    box-shadow: 0 0 0 2px rgba(102,175,233,.20);
    outline: 0;
}

.m4p-price-editor .m4p-save-price-btn {
    font-size: 11px;
    padding: 4px 10px;
    white-space: nowrap;
    border-radius: 3px;
}

.m4p-price-editor .m4p-price-status {
    font-size: 11px;
    margin-left: 8px;
    font-weight: 600;
}

/* Koszty dodatkowe: lista na stronie + wiersze w modalu */
.m4p-additional-costs-tile .m4p-additional-costs-list {
    margin-bottom: 10px;
    min-height: 24px;
}

.m4p-additional-cost-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 6px 8px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

.m4p-additional-cost-item__label {
    flex: 1;
}

.m4p-additional-cost-item__remove {
    flex-shrink: 0;
}

#additional-costs-modal .m4p-additional-cost-modal-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#additional-costs-modal .m4p-additional-cost-modal-row .m4p-cost-name {
    min-width: 140px;
    flex: 1;
}

#additional-costs-modal .m4p-additional-cost-modal-row .m4p-cost-type {
    width: 90px;
}

#additional-costs-modal .m4p-additional-cost-modal-row .m4p-cost-price {
    width: 90px;
}
