@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

/* =============================================
   StoneCarpet Beregner – Urban Hald
   Alle regler er scopet under .st-beregner
   ============================================= */

.st-beregner {
    --primary-green: #375442;
    --light-green: #cee5d9;
    --grey: rgb(227, 227, 227);
    --text-color: rgba(50, 50, 50, 1);
    --border-color: rgba(237, 237, 237, 1);

    font-family: "Poppins", "Arial", sans-serif;
    color: var(--text-color);
    font-size: 13px;
    font-weight: normal;
}

.st-beregner *,
.st-beregner *:before,
.st-beregner *:after {
    box-sizing: border-box;
    outline: none;
}

/* Container */
.st-beregner .container {
    width: 1800px;
    max-width: 90%;
    margin: 0 auto;
    padding: 30px 0;
}

/* Header */
.st-beregner .calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.st-beregner h1 {
    margin: 0 0 10px;
    padding: 0;
    font-size: 28px;
    font-weight: normal;
    line-height: normal;
}

.st-beregner .calculator-header p {
    font-size: 14px;
    color: rgba(100, 100, 100, 1);
    margin: 0;
}

/* Main Grid */
.st-beregner .calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 30px;
}

/* Form Styling */
.st-beregner .form-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.st-beregner .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.st-beregner .form-group label {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-color);
}

.st-beregner .form-group .description {
    font-size: 12px;
    color: rgba(100, 100, 100, 1);
    line-height: 1.0;
    margin-top: 1px;
}

/* Inputs */
.st-beregner input[type="number"],
.st-beregner select {
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 0 10px;
    height: 35px;
    border-radius: 0;
    border: solid 1px var(--border-color);
    background-color: #f6f6f6;
    font-family: "Poppins", "Arial", sans-serif;
    font-size: 12px;
}

.st-beregner select {
    padding-right: 30px;
    background-color: #f6f6f6;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZT0iY3VycmVudENvbG9yIj4KICA8cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGQ9Ik0xOS41IDguMjVsLTcuNSA3LjUtNy41LTcuNSIgLz4KPC9zdmc+");
    background-repeat: no-repeat;
    background-size: 15px auto;
    background-position: calc(100% - 10px) 50%;
}

/* Radio buttons */
.st-beregner .radio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.st-beregner .radio-grid.three-col {
    grid-template-columns: repeat(2, 1fr);
}

.st-beregner .radio-item {
    position: relative;
}

.st-beregner .radio-item input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.st-beregner .radio-item label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 10px;
    border: solid 1px var(--border-color);
    background-color: #f6f6f6;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 12px;
}

.st-beregner .radio-item input[type="radio"]:checked + label {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: rgba(255, 255, 255, 1);
}

.st-beregner .radio-item label:hover {
    border-color: var(--primary-green);
}

/* Color Grid */
.st-beregner .color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.st-beregner .color-item {
    position: relative;
}

.st-beregner .color-item input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.st-beregner .color-item label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 120px;
    padding: 0;
    border: solid 2px var(--border-color);
    background-color: rgba(255, 255, 255, 1);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
}

.st-beregner .color-item label img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.st-beregner .color-item label .color-info {
    padding: 8px;
    width: 100%;
}

.st-beregner .color-item input[type="radio"]:checked + label {
    border-color: var(--primary-green);
    border-width: 3px;
}

.st-beregner .color-item input[type="radio"]:checked + label .color-info {
    background-color: var(--primary-green);
    color: rgba(255, 255, 255, 1);
}

/* Checkbox */
.st-beregner .checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.st-beregner input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    margin: 0;
    outline: none;
    cursor: pointer;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 1);
    border: solid 1px rgba(198, 198, 198, 1);
    flex-shrink: 0;
}

.st-beregner input[type="checkbox"]:checked {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiNmZmZmZmYiIHN0cm9rZS13aWR0aD0iMi41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hlY2siPjxwb2x5bGluZSBwb2ludHM9IjIwIDYgOSAxNyA0IDEyIj48L3BvbHlsaW5lPjwvc3ZnPg==);
    background-repeat: no-repeat;
    background-size: 14px auto;
    background-position: 50% 50%;
}

.st-beregner .checkbox-wrapper label {
    cursor: pointer;
    margin: 0;
    font-size: 15px;
}

/* Binder Selection */
.st-beregner .binder-selection {
    background-color: #f6f6f6;
    border-left: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 15px;
    font-size: 14px;
}

.st-beregner .binder-selection strong {
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 16px;
}

.st-beregner .binder-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.st-beregner .binder-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.st-beregner .binder-option input[type="radio"] {
    margin-top: 2px;
}

.st-beregner .binder-option label {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.st-beregner .binder-option .binder-name {
    display: block;
}

.st-beregner .binder-option .binder-desc {
    font-size: 11px;
    color: rgba(100, 100, 100, 1);
    display: block;
    margin-top: 3px;
}

/* Tooltip */
.st-beregner .tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--primary-green);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
    flex-shrink: 0;
}

.st-beregner .tooltip {
    position: relative;
    display: inline-block;
    margin-bottom: 5px;
}

.st-beregner .tooltip-content {
    visibility: hidden;
    width: 320px;
    background-color: var(--light-green);
    color: #161616;
    border-radius: 8px;
    padding: 15px;
    position: absolute;
    z-index: 1000;
    bottom: auto;
    top: 125%;
    left: 50%;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 11px;
    line-height: 1.5;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    max-width: calc(100vw - 30px);
    transform: translateX(-50%);
}

.st-beregner .tooltip-content::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--light-green) transparent;
}

.st-beregner .tooltip.align-left .tooltip-content::before {
    left: 20px;
    transform: none;
}

.st-beregner .tooltip.align-right .tooltip-content::before {
    left: auto;
    right: 20px;
    transform: none;
}

.st-beregner .tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--light-green) transparent transparent transparent;
}

.st-beregner .tooltip-content strong {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.st-beregner .tooltip-content ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.st-beregner .tooltip-content li {
    margin-bottom: 3px;
}

.st-beregner .tooltip-content em {
    display: block;
    margin-top: 8px;
    font-style: normal;
    opacity: 0.8;
    font-size: 11px;
}

/* Recommendation Box */
.st-beregner .recommendation-box {
    background-color: var(--light-green);
    border-left: 4px solid var(--primary-green);
    padding: 15px;
    border-radius: 3px;
    font-size: 12px;
}

.st-beregner .recommendation-box strong {
    font-weight: 500;
}

/* Result Section */
.st-beregner .result-section {
    background-color: #f6f6f6;
    padding: 25px;
    border-radius: 3px;
}

.st-beregner .result-section h2 {
    margin: 0 0 25px;
    padding: 0;
    font-size: 24px;
    font-weight: normal;
}

/* Price Summary */
.st-beregner .price-summary {
    background-color: var(--primary-green);
    color: rgba(255, 255, 255, 1);
    padding: 30px;
    border-radius: 3px;
    text-align: center;
    margin-bottom: 25px;
}

.st-beregner .price-summary .label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.st-beregner .price-summary .amount {
    font-size: 42px;
    font-weight: 300;
    margin: 0;
}

/* Materials List */
.st-beregner .materials-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.st-beregner .material-item {
    background: white;
    padding: 15px;
    border-radius: 3px;
    display: grid;
    grid-template-columns: 50px 1fr auto auto;
    gap: 15px;
    align-items: center;
    border: solid 1px var(--border-color);
}

.st-beregner .product-image {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 3px;
}

.st-beregner .product-image img {
    max-width: 50px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.st-beregner .material-name {
    font-weight: 400;
    font-size: 13px;
}

.st-beregner .material-quantity {
    color: rgba(100, 100, 100, 1);
    font-size: 12px;
}

.st-beregner .material-price {
    font-weight: 500;
    color: var(--primary-green);
    font-size: 15px;
}

.st-beregner .material-price strike {
    color: rgba(100, 100, 100, 1);
    font-weight: 300;
    font-size: 13px;
    margin-right: 8px;
}

.st-beregner .material-price .sale {
    font-weight: 500;
    color: var(--primary-green);
}

/* Info Box */
.st-beregner .info-box {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 3px;
    padding: 15px;
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.6;
}

.st-beregner .info-box strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.st-beregner .hidden {
    display: none;
}

/* Action Buttons */
.st-beregner .action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.st-beregner .button {
    background-color: rgba(0, 0, 0, 1);
    color: rgba(255, 255, 255, 1);
    border-radius: 25px;
    border: none;
    display: inline-flex;
    min-height: 35px;
    font-size: 14px;
    padding: 10px 35px;
    justify-content: center;
    align-items: center;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 300;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    font-family: "Poppins", "Arial", sans-serif;
    transition: background-color 0.2s;
    flex: 1;
}

.st-beregner .button:hover {
    background-color: rgba(70, 70, 70, 1);
}

.st-beregner .button.secondary {
    background-color: var(--grey);
    color: rgba(0, 0, 0, 1);
}

.st-beregner .button.secondary:hover {
    background-color: rgba(200, 200, 200, 1);
}

/* Accessories/Værktøj Section */
.st-beregner .accessories-section {
    border-top: 2px solid var(--border-color);
    padding-top: 25px;
    margin-top: 30px;
}

.st-beregner .accessories-section h3 {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 10px;
    color: var(--text-color);
}

.st-beregner .accessories-intro {
    font-size: 12px;
    color: rgba(100, 100, 100, 1);
    margin-bottom: 20px;
}

.st-beregner .accessories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.st-beregner .accessory-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 7px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
}

.st-beregner .accessory-item:hover {
    border-color: var(--primary-green);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.st-beregner .accessory-item input[type="checkbox"] {
    width: 30px;
    height: 30px;
}

.st-beregner .accessory-item .accessory-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.st-beregner .accessory-details {
    flex: 1;
}

.st-beregner .accessory-item .accessory-name {
    font-size: 12px;
    font-weight: 400;
    margin-bottom: 3px;
    color: var(--text-color);
}

.st-beregner .accessory-item .accessory-price {
    font-size: 12px;
    color: var(--primary-green);
    font-weight: 500;
}

.st-beregner .accessory-item .accessory-price strike {
    font-size: 11px;
    color: rgba(100, 100, 100, 1);
    font-weight: 400;
}

.st-beregner .accessory-item input[type="checkbox"]:checked ~ .accessory-info .accessory-name {
    color: var(--primary-green);
}

/* Sticky mobile price bar */
.st-beregner .sticky-price-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 7%;
    right: 7%;
    z-index: 999;
    background-color: var(--primary-green);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
}

.st-beregner .sticky-price-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.st-beregner .sticky-price-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.st-beregner .sticky-price-amount {
    font-size: 22px;
    font-weight: 500;
}

/* Mobile tooltip bottom-sheet overlay */
.st-beregner .tooltip-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
}

.st-beregner .tooltip-overlay.visible {
    display: flex;
}

.st-beregner .tooltip-sheet {
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 24px 20px 32px;
    width: 100%;
    max-width: 600px;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-color);
    animation: stSheetSlideUp 0.25s ease-out;
}

.st-beregner .tooltip-sheet-handle {
    width: 36px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 0 auto 16px;
}

@keyframes stSheetSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 1024px) {
    .st-beregner .calculator-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .st-beregner .container {
        padding: 30px 0;
    }

    .st-beregner h1 {
        font-size: 20px;
    }

    .st-beregner .calculator-header p {
        font-size: 12px;
    }

    .st-beregner .sticky-price-bar {
        display: block;
    }

    /* Giv beregneren padding i bunden så indhold ikke gemmes bag sticky bar */
    .st-beregner {
        padding-bottom: 55px;
    }
}

@media (max-width: 768px) {
    .st-beregner .color-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .st-beregner .result-section {
        padding: 18px;
    }

    .st-beregner .material-item {
        grid-template-columns: 30px 1fr auto auto;
        padding: 10px;
        gap: 8px;
    }

    .st-beregner .product-image {
        width: 30px;
        height: 30px;
    }

    .st-beregner .product-image img {
        max-width: 30px;
        max-height: 30px;
    }

    .st-beregner .material-name {
        font-size: 12px;
    }

    .st-beregner .material-quantity {
        order: 3;
        font-size: 10px;
    }

    .st-beregner .material-price {
        order: 2;
        text-align: left;
        font-size: 13px;
    }

    .st-beregner .price-summary .amount {
        font-size: 32px;
    }

    .st-beregner .accessories-grid {
        grid-template-columns: 1fr;
    }

    .st-beregner .tooltip-content {
        width: 280px;
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 480px) {
    .st-beregner .tooltip-content {
        width: 90vw;
        max-width: 250px;
        left: auto;
        right: -25px;
        margin-left: 0;
    }

    .st-beregner .tooltip-content::after {
        left: auto;
        right: 15px;
    }

    .st-beregner .checkbox-wrapper {
        align-items: flex-start;
    }
}
@media (hover: hover) {
    .st-beregner .tooltip:hover .tooltip-content {
        visibility: hidden;
        opacity: 0;
    }
}
