* {
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background-color: #f2f2f2;
    padding: 40px;
}

.calculator {
    max-width: 420px;
    margin: auto;
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    margin-bottom: 24px;
}

.section {
    margin-bottom: 24px;
}

.section h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

label {
    font-size: 14px;
    margin-bottom: 4px;
}

input,
select {
    padding: 8px;
    font-size: 14px;
}

.radio-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
}

.note {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.color-picker {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.color {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
}

.c1  { background: #ffffff; }
.c2  { background: #000000; }
.c3  { background: #c2c2c2; }
.c4  { background: #8d6e63; }
.c5  { background: #c62828; }
.c6  { background: #2e7d32; }
.c7  { background: #1565c0; }
.c8  { background: #f9a825; }
.c9  { background: #6a1b9a; }
.c10 { background: #6e3d2d; }

.calculate {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background: #000;
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 3px;
}

.calculate:hover {
    background: #333;
}

#preview {
    width: 100%;
    max-width: 100%;
    display: grid;
    gap: 1px;
    margin-top: 16px;
    background: #eee;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.tile-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.tile-option {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 10px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tile-option.selected {
    border-color: #000;
}

.tile-option span {
    font-size: 13px;
}

/* DIBUJO DE LA BALDOSA */
.tile-shape {
    background: #ccc;
    border: 1px solid #999;
}

/* Proporciones */
.square {
    width: 40px;
    height: 40px;
}

.r-15x20 {
    width: 30px;
    height: 40px;
}

.r-15x30 {
    width: 30px;
    height: 60px;
}

.r-10x20 {
    width: 20px;
    height: 40px;
}

.r-20x40 {
    width: 40px;
    height: 80px;
}

.r-30x15 {
    width: 60px;
    height: 30px;
}

.r-20x10 {
    width: 40px;
    height: 20px;
}

.r-40x20 {
    width: 80px;
    height: 40px;
}

/* Responsive */
@media (max-width: 480px) {
    .tile-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

.texture-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.texture-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    cursor: pointer;
    text-align: center;
}

.texture-option.selected {
    border-color: #000;
}

.texture-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin-bottom: 6px;
}

.texture-option span {
    font-size: 12px;
}

.distribution-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.distribution-option {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 6px;
    background: #fff;
    cursor: pointer;
    text-align: center;
}

.distribution-option.selected {
    border-color: #000;
}

.distribution-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin-bottom: 6px;
}

.distribution-option span {
    font-size: 12px;
}



