:root {
    --green: #c5d4a7;
    --green-dark: #505a3e;
    --beige: #f5e8dc;
    --light-beige: #fdfaf7;
    --text-color: #5f5d5b;
    --border-color: #e5e0db;
    --header-font: 'Cormorant Garamond', serif;
    --body-font: 'Montserrat', sans-serif;
}

body {
    font-family: var(--body-font);
    background-color: #555;
    color: var(--text-color);
    margin: 0;
    padding: 3em 1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    width: 100%;
    background-color: var(--beige);
    background-image: linear-gradient(rgba(255,255,255,0.35), rgba(255,255,255,0.35)), url('фон.png');
    background-size: 100% 100%;
    background-position: center;
    padding: 2em;
    border-radius: 5px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    margin-bottom: 2em;
}

.container-page2::before,
.container-page2::after {
    display: none;
}

/* Эвкалипт слева — выше, уходит влево за край */
.container::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 280px;
    left: -120px;
    top: 160px;
    background-image: url('eucalyptus.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
    opacity: 0.9;
    z-index: 100;
    pointer-events: none;
}

/* Эвкалипт справа — ниже, уходит вправо за край */
.container::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 280px;
    right: -90px;
    top: 520px;
    background-image: url('eucalyptus.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right center;
    transform: scaleX(-1);
    opacity: 0.9;
    z-index: 100;
    pointer-events: none;
}

header {
    text-align: center;
    padding: 1.5em 0;
    position: relative;
    z-index: 3; /* Set stacking context */
}

h1 {
    font-family: var(--header-font);
    font-size: 3em;
    color: var(--green-dark);
    margin: 0;
    font-weight: 700;
    letter-spacing: 2px;
}

.sub-header {
    font-family: var(--header-font);
    font-size: 1.2em;
    color: var(--green-dark);
    margin-top: 0.5em;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.sub-header span {
    margin: 0 0.8em;
}

.info-blocks {
    display: flex;
    justify-content: center;
    gap: 1.5em;
    position: relative;
    z-index: 3;
    margin-top: 2em;
    margin-bottom: 5em;
    padding: 0 1.5em;
}

.info-blocks-divider {
    width: 1px;
    flex-shrink: 0;
    align-self: stretch;
    background: rgba(0, 0, 0, 0.12);
    margin: 0 0.25em;
}

.info-block {
    flex: 1;
    min-width: 0;
}

.img-upload-wrap {
    position: relative;
    margin-bottom: 0.5em;
}

.img-upload-wrap img {
    display: block;
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: center;
    border-radius: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.img-upload-wrap-product img {
    width: 100%;
    height: 200px;
    margin: 0 auto;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
}

.img-upload-wrap-avatar img {
    width: 180px;
    height: 270px;
    margin: 0 auto;
    object-fit: cover;
    object-position: center;
    border-radius: 24px;
}

.img-upload-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    margin-top: 0.5em;
}

.img-upload-btn {
    display: inline-block;
    margin-top: 0;
    padding: 0.35em 0.75em;
    font-size: 0.85em;
    color: var(--text-color);
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.img-position-select {
    font-family: var(--body-font);
    font-size: 0.8em;
    padding: 0.3em 0.5em;
    color: var(--text-color);
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.img-position-select:focus {
    outline: none;
    border-color: var(--green);
}

.img-upload-btn:hover {
    background: #fff;
    border-color: var(--green);
}

.img-upload-wrap-product .img-upload-btn {
    margin-top: 0.4em;
    padding: 0.25em 0.5em;
    font-size: 0.8em;
}

.img-upload-wrap-avatar .img-upload-btn {
    display: block;
    text-align: center;
    margin-top: 0.5em;
}

.info-block .img-upload-wrap {
    margin-bottom: 1.5em;
}

.info-block p {
    margin: 0.5em 0;
    font-size: 0.9em;
    display: flex;
    align-items: flex-start;
    text-align: left;
    gap: 8px;
    color: #6c6c6c;
}

.info-block p .icon {
    margin-top: 3px;
    flex-shrink: 0;
}

.icon svg {
    fill: var(--green);
}

main {
    position: relative;
    z-index: 3; /* Set stacking context */
    /* REMOVED BACKGROUND COLOR */
    border-radius: 10px;
    padding: 1px;
}

.main-table {
    padding: 0 1.5em;
    margin-bottom: 1em;
}

.main-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 6px;
    margin-bottom: 3em;
}

.main-table th, .main-table td {
    padding: 1.1em 1.3em;
    text-align: left;
}

.main-table th {
    background-color: var(--green);
    color: #444;
    font-weight: 700;
    font-size: 1em;
}
.main-table thead th:first-child {
    border-top-left-radius: 10px;
}
.main-table thead th:last-child {
    border-top-right-radius: 10px;
}
.main-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}
.main-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

.main-table td:first-child {
    font-weight: 700;
    color: #444;
}

.main-table tbody tr {
    background-color: rgba(238, 226, 213, 0.3);
}

.main-table tbody tr:nth-child(even) {
    background-color: rgba(238, 226, 213, 0.3);
}


.products {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 1.5em;
    margin-bottom: 3em;
    padding: 0 1.5em;
}

.product-card-wrap {
    position: relative;
    flex: 0 1 calc((100% - 2 * 1.5em) / 3);
    min-width: 200px;
}

.product-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.product-remove:hover {
    background: #c62828;
}

.add-product {
    width: 100%;
    padding: 0.75em 1em;
    margin-top: 0.5em;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background: rgba(255,255,255,0.6);
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.add-product:hover {
    background: rgba(197, 212, 167, 0.3);
    border-color: var(--green);
}

.product {
    background-color: var(--light-beige);
    padding: 1.5em 1em;
    border-radius: 15px;
    text-align: center;
    flex: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.product img {
    width: 100%;
    height: 200px;
    margin: 0 auto 1em auto;
    display: block;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
}

.product h3 {
    font-family: var(--header-font);
    font-size: 1.2em;
    margin: 0 0 0.2em 0;
    font-weight: 700;
    color: var(--green-dark);
}

.product p {
    margin: 0 0 1em 0;
    font-size: 0.9em;
    color: #888;
}

.product table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 5px;
    font-size: 0.9em;
    border-radius: 12px;
}

.product th, .product td {
    padding: 0.6em 0.2em;
    text-align: left;
    background-color: rgba(238, 226, 213, 0.3);
}
.product th {
    color: #444;
    font-weight: 500;
}
.product thead th:first-child {
    border-top-left-radius: 12px;
}
.product thead th:last-child {
    border-top-right-radius: 12px;
}
.product tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}
.product tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.product td:not(:first-child) {
    text-align: right;
    font-weight: 500;
}
.product tr > th:nth-child(2),
.product tr > td:nth-child(2),
.product tr > td:nth-child(3) {
    text-align: right;
    padding-right: 1em;
}
.product td:nth-child(2),
.product td:nth-child(3) {
    font-weight: 700;
}


footer {
    text-align: center;
    padding: 2em 0;
    position: relative;
    z-index: 3; /* Set stacking context */
}

.totals {
    display: flex;
    justify-content: center;
    gap: 1em;
    align-items: center;
    margin-bottom: 1.5em;
}

.total-item {
    background: var(--light-beige);
    padding: 0.5em 1.2em;
    border-radius: 8px;
    min-width: 160px;
    border: 1px solid #e9e4e0;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.03);
}

.total-item div:first-child {
    font-size: 1em;
    color: #444;
}

.total-item .price {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-color);
}

.sub-footer {
    font-family: var(--header-font);
    font-size: 1.5em;
    letter-spacing: 2px;
    color: var(--green-dark);
}

.create-btn-wrap {
    margin-top: 2em;
    padding-top: 1.5em;
    text-align: center;
    max-width: 1100px;
    width: 100%;
}

.btn-create {
    font-family: var(--body-font);
    font-size: 1.1em;
    font-weight: 600;
    padding: 0.6em 1.8em;
    border: none;
    border-radius: 8px;
    background: var(--green);
    color: #505a3e;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn-create:hover {
    background: #b8c59c;
}
.btn-create:active {
    transform: scale(0.98);
}

/* Вторая страница конструктора (2c) */
.page2-section {
    padding: 0 1.5em;
    margin-bottom: 2.5em;
    position: relative;
    z-index: 3;
}

.page2-title {
    font-family: var(--header-font);
    font-size: 1.8em;
    color: var(--green-dark);
    text-align: center;
    margin: 0 0 1em 0;
    font-weight: 700;
}

.page2-included {
    list-style: none;
    padding: 0 0 0 1.2em;
    margin: 0;
    border-left: 4px solid var(--green);
}

.page2-included li {
    padding: 0.35em 0;
    font-size: 0.95em;
    color: #444;
}

.page2-desc {
    margin: 0 0 1em 0;
    font-size: 0.95em;
    color: #444;
}

.page2-social {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2em;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9em;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 700;
    background: var(--green);
    color: var(--green-dark);
}

.social-tg { border-radius: 50%; }

.page2-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 6px;
}

.page2-table th,
.page2-table td {
    padding: 0.75em 1em;
    text-align: left;
    background-color: rgba(238, 226, 213, 0.3);
}

.page2-table th {
    background-color: var(--green);
    color: #444;
    font-weight: 700;
    font-size: 0.95em;
}

.page2-table td:not(:first-child) {
    text-align: right;
}

.page2-table .page2-total-row td {
    font-weight: 600;
    background-color: rgba(238, 226, 213, 0.3);
}

.page2-table-small .page2-table th:first-child,
.page2-table-small .page2-table td:first-child {
    width: 45%;
}

.page2-total-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1em;
    align-items: stretch;
}

.page2-price-btn {
    flex: 1 1 0;
    min-width: 160px;
    max-width: 280px;
    padding: 0.75em 1.2em;
    border: none;
    border-radius: 12px;
    background: var(--green);
    color: var(--green-dark);
    text-align: center;
    box-shadow: 0 4px 12px rgba(197, 212, 167, 0.5);
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page2-price-label {
    display: block;
    font-size: 1em;
    opacity: 0.95;
    margin-bottom: 0.25em;
}

.page2-price-value {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
}

.page2-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 1.5em;
    padding: 2em 1.5em;
    margin-top: 2em;
}

.page2-contact-photo {
    position: relative;
    flex-shrink: 0;
}

.page2-contact-photo img {
    width: 320px;
    height: 420px;
    border-radius: 24px;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.page2-logo-overlay {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 44px;
    height: 44px;
    background: var(--green);
    color: #505a3e;
    font-weight: 700;
    font-size: 0.9em;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.page2-contact-text {
    flex: 0 1 auto;
    min-width: 200px;
    max-width: 420px;
}

.page2-greeting {
    margin: 0 0 0.5em 0;
    font-size: 1em;
    color: #444;
}

.page2-tagline {
    margin: 0 0 1em 0;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-color);
}

.page2-contacts {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.95em;
    color: #444;
}

.contact-item .icon {
    display: inline-flex;
    align-items: center;
    margin-right: 0.2em;
}

.contact-item .icon svg {
    fill: var(--green);
    width: 24px;
    height: 24px;
}

[contenteditable="true"] {
    outline: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

[contenteditable="true"]:hover {
    background-color: #fff9e1;
    box-shadow: 0 0 0 2px #fff9e1;
}
[contenteditable="true"]:focus {
    background-color: white;
    box-shadow: 0 0 0 2px var(--green);
}
