/* :root {
    --global-palette1: #ff9b00;
    --global-palette3: #1A202C;
    --global-palette-btn-bg: #2d3748;
}  */

#cubeweld-configurator {
    max-width: 420px;
}

.config-section-label {
    background: rgb(217,217,217);
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2em 1em;
    display: block;
    color: rgb(32,32,32);
    margin-top: 0;
    margin-bottom: 0.5em;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.2em;
}

.config-section {
    margin-bottom: 1em;
    border: none;
    background: none;
}

.config-section label {
    font-weight: 500;
    margin-bottom: 0.2em;
    display: block;
}

.config-section select,
.config-section input[type="number"] {
    width: 100%;
    padding: 0.5em 0.8em;
    font-size: 1em;
    margin-bottom: 0.5em;
    border-color: rgb(217,217,217);
}

.config-section select.error,
.config-section input[type="number"].error {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: -0.3em;
    margin-bottom: 0.5em;
    display: block;
}

.dimensions {
    display: flex;
    gap: 0.7em;
    margin-bottom: 0.5em;
}

.dimensions label {
    flex: 1 1 0;
    margin-bottom: 0;
}

#table-config-form button[type="submit"],
#add-to-cart-config {
    background: var(global-palette-btn-bg);
    color: var(--global-palette1);
    border: none;
    border-radius: 0;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 1em 1em;
    width: 100%;
    margin-top: 1em;
    transition: background 0.2s;
    cursor: pointer;
}

#add-to-cart-config {
    margin-top: 2em;
}

#table-config-form button[type="submit"]:hover,
#add-to-cart-config:hover {
    background: var(--global-palette1);
    color: #ffffff;
}

#table-config-form button[type="submit"]:disabled,
#add-to-cart-config:disabled {
    background: #dbe2ea;
    color: #888;
    cursor: not-allowed;
}

#calculation-results {
    margin-top: 1.5em;
    padding: 1em;
    border: 1px solid #dbe2ea;
    box-shadow: 0 1px 4px rgba(30,40,60,0.04);
}

#calculation-results h4 {
    color: #232f3e;
    font-size: 1.08em;
    font-weight: 700;
    margin: 0 0 0.7em 0;
    letter-spacing: 0.2px;
}

.calculation-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.breakdown-item {
    background: none;
    border: none;
    padding: 0.2em 0;
    font-size: 1em;
    color: #232f3e;
    line-height: 1.5;
}

.breakdown-item strong {
    color: #232f3e;
    font-weight: 700;
}

.breakdown-item.total-price {
    font-size: 1.4em;
}

.breakdown-item.total-price .total-price-label {
    font-weight: 700;
    margin-top: 0.5em;
    text-transform: uppercase;
    background: var(--global-palette1);
    padding: 0.2em 0.7em;
    line-height: 1.2em;
    letter-spacing: 4px;
    text-align: center;
}

.breakdown-item.total-price .total-price-value {
    font-weight: 700;
    margin-top: 0.2em;
    padding: 0em 0.5em;
    text-align: center;
    font-size: 1.2em;
}

.description {
    color: #888;
    font-size: 0.92em;
    margin-bottom: 0;
    margin-top: 0.2em;
}

/* Animacje */
.config-section {
    transition: border-color 0.2s ease;
}

.config-section:hover {
    border-color: var(--global-palette1);
}

/* Efekt hover na przyciskach */
#table-config-form button[type="submit"]:hover,
#add-to-cart-config:hover {
    background: var(--global-palette1);
}

/* Animacja fadeIn dla wyników */
#calculation-results {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sekcja galerii zdjęć */
.image-gallery-section {
    margin-top: 1em;
    padding-top: 1em;
    border-top: 1px solid #dbe2ea;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8em;
    margin-top: 0.5em;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
    max-width: 120px;
}

.gallery-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid var(--global-palette1);
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f5f5f5;
}

.gallery-thumbnail:hover {
    border-color: var(--global-palette-btn-bg);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.gallery-label {
    font-size: 0.75em;
    color: #666;
    margin-top: 0.3em;
    line-height: 1.2;
    font-weight: 500;
    max-width: 100%;
    word-wrap: break-word;
}

.preview-btn {
    padding: 0 0.4em;
    background: var(--global-palette1);
    margin: 0 0 0 0.2em;
    display: inline-block;
    line-height: inherit;
    color: var(--global-palette3);
    text-transform: uppercase;
}

.preview-btn:hover {
    background: var(--global-palette-btn-bg);
    color: var(--global-palette1);
}

/* Focus states */
.config-section select:focus,
.config-section input[type="number"]:focus {
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.2);
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--global-palette1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}