* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: aliceblue;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.crud .container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  padding: 10px;
}

.head {
  text-align: center;
  margin: 20px 0;
  text-transform: uppercase;
}

input {
  width: 100%;
  border: none;
  height: 40px;
  background-color: #fff6f6;
  margin: 10px 0;
  border-radius: 5px;
  padding: 10px 15px;
  box-shadow: 1px 1px 10px #00000030;
  font-size: 1rem;
}

input:focus {
  transform: scale(1.03);
  outline: none;
}

.price {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.price input {
  flex: 1 1 22%;
  min-width: 100px;
}

#total {
  background-color: #a00d02;
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  margin: 0 5px;
  flex: 1 1 100%;
  text-align: center;
  font-weight: bold;
}

button {
  width: 100%;
  padding: 10px;
  border: none;
  background-color: #3754f5;
  margin: 10px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
  color: #fff;
  font-weight: bold;
}

button:hover {
  background-color: #283ebb;
  letter-spacing: 1px;
}

#deleteAll #delete {
  display: none;
}

.btn {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.btn button {
  flex: 1 1 48%;
}

table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
  text-transform: uppercase;
  overflow-x: auto;
}

th,
td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: center;
  font-size: 0.9rem;
}

thead {
  background-color: #3754f5;
  color: white;
}

tbody tr:nth-child(even) {
  background-color: #f2f2f2;
}

/* Responsive */
@media screen and (max-width: 1024px) {
  .price input {
    flex: 1 1 48%;
  }
  .btn button {
    flex: 1 1 48%;
  }
}

@media (max-width: 768px) {
  table th {
    display: none; /* إخفاء الكرت الذي يحتوي على العناوين */
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    margin-bottom: 1rem;
    padding: 15px;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  td {
    text-align: right;

    position: relative;
    border: none;
    border-bottom: 1px solid #eee;
  }

  td::before {
    content: attr(data-label);
    position: absolute;
    left: 15px;
    width: 45%;
    padding-left: 10px;
    font-weight: bold;
    text-align: left;
  }

  /* استثناء أزرار Update و Delete من ظهور العنوان */
  td:last-child::before,
  td:nth-last-child(2)::before {
    content: "";
  }
}
