body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0d0d0f;
  color: #e5e5e5;
  margin: 0;
  padding: 20px;
}

header a:hover img {
  transform: scale(1.05);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 28px;
  color: #ff3c3c;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
}

.cart-btn {
  position: relative;
  background: #1a1a1d;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  color: #e5e5e5;
  font-weight: bold;
  transition: 0.2s;
}
.cart-btn:hover {
  background: #2a2a2f;
  box-shadow: 0 0 10px #ff3c3c;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff3c3c;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 50%;
  box-shadow: 0 0 6px #ff3c3c;
}

.cart-dropdown {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: #1a1a1d;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
  width: 280px;
  z-index: 10;
  padding: 10px;
}
.cart-dropdown.active {
  display: block;
}
.cart-item {
  border-bottom: 1px solid #333;
  padding: 6px 0;
  font-size: 14px;
}
.cart-footer {
  margin-top: 10px;
  text-align: right;
  font-weight: bold;
  color: #ff3c3c;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}
.controls select,
.controls input {
  padding: 6px;
  background: #1a1a1d;
  border: 1px solid #444;
  border-radius: 6px;
  color: #e5e5e5;
}
.controls input[type="range"] {
  accent-color: #ff3c3c;
}
#catalog {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(4, 1fr);
  justify-content: center;
  max-width: 1500px;
  margin: 0 auto;
}



.card {
  width: 100%;             
  max-width: 550px;        
  background: #1a1a1d;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 350px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  box-shadow: 0 0 15px #ff3c3c;
  transform: translateY(-3px);
}

.card img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 6px;
}
.meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.author {
  font-weight: bold;
  font-size: 14px;
  color: #8b8989;
}
.phrase {
  font-weight: bold;
  font-size: 16px;
  color: #c3c1c1;
}
.price {
  font-weight: bold;
  margin-top: 4px;
  color: #ff3c3c;
}
.small {
  font-size: 12px;
  color: #777;
}

button.add-btn {
  margin-top: 6px;
  width: 100%;
  padding: 6px;
  background: #1ca54e;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}
button.add-btn:hover {
  background: #e60000;
  box-shadow: 0 0 12px #ff3c3c;
}

#checkout {
  background: #ff3c3c;
  border: none;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}
#checkout:hover {
  background: #e60000;
  box-shadow: 0 0 12px #ff3c3c;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  font-family: sans-serif;
}

.play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #e62d2d;
  background: #101014;
  color: #ff3c3c;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

.play-btn:hover {
  background: #ff3c3c;
  color: #fff;
  box-shadow: 0 0 10px #c30000;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.progress-bar {
  position: relative;
  flex: 1;
  height: 6px;
  background: #2c2c2f;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #ff3c3c;
  transition: width 0.1s linear;
}

.current-time,
.duration {
  font-size: 12px;
  color: #ccc;
}


#tiFilters .ti-btn {
  background: #1a1a1d;
  border: 2px solid #ff3c3c;
  color: #ff3c3c;
  font-weight: bold;
  padding: 6px 14px;
  margin: 5px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}
#tiFilters .ti-btn:hover {
  background: #ff3c3c;
  color: #1a1a1d;
}
#tiFilters .ti-btn.active {
  background: #ff3c3c;
  color: #1a1a1d;
  box-shadow: 0 0 6px rgba(255,60,60,0.6);
}



.modal {
  display: none;
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #1a1a1d;
  padding: 30px;
  border: 1px solid #444;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255, 60, 60, 0.5);
  width: 90%;
  max-width: 500px;
  position: relative;
  animation: modal-fadein 0.3s;
}

@keyframes modal-fadein {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.close-btn {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #ff3c3c;
}

.order-summary {
  background: #0d0d0f;
  border: 1px solid #333;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  margin-bottom: 20px;
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 14px;
  color: #e5e5e5;
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.copy-btn, .seller-link {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  text-align: center;
  text-decoration: none;
  color: #fff;
}

.copy-btn {
  background: #22c55e;
}

.copy-btn:hover {
  background: #1a9f4a;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.seller-link {
  background: #ff3c3c;
}

.seller-link:hover {
  background: #e60000;
  box-shadow: 0 0 10px rgba(255, 60, 60, 0.5);
}












.hero {
    text-align: center;
    padding: 40px 20px;
    max-width: 850px;
    margin: auto;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.hero p {
    opacity: 0.8;
    line-height: 1.6;
}

        .items {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 30px;
            padding: 60px 40px;
            max-width: 1400px;
            margin: 0 auto;
        }

        .item {
            width: calc(25% - 23px);
            max-width: 300px;
        }

        .item:nth-child(n+5) {
            width: calc(25% - 23px);
            max-width: 300px;
        }

        .item {
            background: #1a1a1d;
            border: 1px solid #333;
            border-radius: 12px;
            overflow: hidden;
            text-decoration: none;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            position: relative;
        }

        .item:hover {
            transform: translateY(-8px);
            box-shadow: 0 0 25px #ff3c3c;
        }

        .item img {
            width: 100%;
            height: 250px;
            object-fit: cover;
            display: block;
        }

        .tag {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: #ff3c3c;
            color: #fff;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            font-weight: bold;
            font-size: 16px;
            cursor: pointer;
            transition: 0.3s;
            box-shadow: 0 4px 15px rgba(255, 60, 60, 0.4);
        }

        .tag:hover {
            background: #e60000;
            box-shadow: 0 6px 20px rgba(255, 60, 60, 0.7);
            transform: translateX(-50%) scale(1.05);
        }

        .footer {
            text-align: center;
            padding: 30px 20px;
            background: #1a1a1d;
            border-top: 2px solid #ff3c3c;
            color: #8b8989;
            font-style: italic;
            font-size: 14px;
        }

        @media (max-width: 768px) {
            .header {
                flex-direction: column;
                gap: 15px;
                padding: 15px 20px;
            }

            .search {
                width: 100%;
            }

            .hero h1 {
                font-size: 32px;
            }

            .hero p {
                font-size: 16px;
            }

            .items {
                padding: 30px 20px;
            }

            .item {
                width: 100%;
                max-width: none;
            }

            .item:nth-child(n+5) {
                width: 100%;
                max-width: none;
            }
        }
/* ===== MOBILE FILTERS ONLY (CLEAN) ===== */
@media (max-width: 900px){

  .controls{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }

  #search{
    width: 100% !important;
    min-width: 0 !important;
  }

  .controls input,
  .controls select{
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
  }

  .controls input[type="range"]{
    width: 100%;
    height: 34px;
    padding: 0;
    margin-top: 4px;
  }

  .controls .small{
    width: 100%;
    font-size: 14px;
    opacity: 0.85;
  }

  #tiFilters{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  #tiFilters .ti-btn{
    margin: 0;
    flex: 1 1 140px;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 10px;
  }
}

@media (max-width: 560px){
  .controls input,
  .controls select{
    height: 46px;
    font-size: 16px; /* без зуму на iOS */
  }

  #tiFilters .ti-btn{
    flex: 1 1 100%;
  }
}
/* ===== FIX SEARCH WIDTH (REMOVE EMPTY RIGHT SPACE) ===== */
@media (max-width: 900px){
.controls{
  display: flex;
  flex-direction: column;
}

/* ВСЕ фильтры занимают 100% строки */
.controls > *{
  width: 100%;
  flex: 0 0 100%;
}

/* одинаковая высота */
.controls input[type="text"],
.controls select{
  height: 44px;
  padding: 0 14px;
  box-sizing: border-box;
}

/* перебиваем inline-стиль поиска */
#search{
  min-width: 0 !important;
  width: 100% !important;
}

/* range отдельно */
.controls input[type="range"]{
  height: 34px;
  padding: 0;
}
/* ===== RESPONSIVE CARDS GRID (popular + all phrases) ===== */


#catalog{
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
}

/* убираем ограничение ширины карточек */
.card{
  max-width: none;
}

@media (max-width: 600px){
  #catalog{
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card{
    padding: 8px;
    min-height: unset;
  }

  .card img{
    height: 140px;
    object-fit: cover;
  }

  .phrase{
    font-size: 14px;
    line-height: 1.25;
  }

  .author,
  .small{
    font-size: 12px;
  }

  .price{
    font-size: 14px;
  }
}
@media (max-width: 600px){
  .audio-player{
    gap: 6px;
    margin: 6px 0;
  }

  .play-btn{
    width: 34px;
    height: 34px;
    font-size: 14px;
    /* Покращення для тач-пристроїв */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  button.add-btn{
    padding: 6px;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .progress-bar{
    height: 8px; /* Більша висота для легшого натискання */
    touch-action: manipulation;
  }
}
/* ===== FIX CARD SPACING (LEFT / CENTER / RIGHT) ===== */

/* Основной контейнер карточек */
#catalog{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 в ряд */
  gap: 16px;                    /* расстояние МЕЖДУ карточками */
  padding: 0 12px;              /* расстояние СЛЕВА и СПРАВА */
  box-sizing: border-box;
}

/* На планшетах и ПК — адаптив */
@media (min-width: 601px){
  #catalog{
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    padding: 0 20px;
  }
}

/* Карточка не должна вылазить */
.card{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
}


/* ===== MOBILE FILTERS TOGGLE ===== */
.filters-toggle{
  display: none;
}

@media (max-width: 900px){

  /* кнопка ФИЛЬТРЫ */
  .filters-toggle{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: #ff3c3c;
    color: #000;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
  }

  /* сами фильтры скрыты */
  .controls{
    display: none;
    flex-direction: column;
    gap: 10px;
    background: #111;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #333;
  }

  /* когда открыты */
  .controls.active{
    display: flex;
  }

  /* кнопки TI компактно */
  #tiFilters{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  #tiFilters .ti-btn{
    padding: 10px;
    font-size: 14px;
  }
}

