_faq.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. .faq {
  2. display: flex;
  3. flex-direction: column;
  4. gap: 16px;
  5. &__title {
  6. margin:0;
  7. margin-bottom: 24px;
  8. font-weight: 600;
  9. color: var(--text-color);
  10. }
  11. &__item {
  12. border-radius: 12px;
  13. overflow: hidden;
  14. transition: all 0.3s ease;
  15. border: 1px solid var(--content-border-color);
  16. background: var(--content-bg-color);
  17. &.active {
  18. .faq__question::after {
  19. transform: rotate(45deg);
  20. }
  21. .faq__question::before {
  22. transform: rotate(-45deg);
  23. }
  24. .faq__answer {
  25. opacity: 1;
  26. }
  27. }
  28. }
  29. &__question {
  30. padding: 20px 56px 20px 24px;
  31. cursor: pointer;
  32. position: relative;
  33. user-select: none;
  34. transition: background-color 0.2s ease;
  35. display: flex;
  36. align-items: center;
  37. gap: 16px;
  38. @include mobile{
  39. padding: 16px 56px 16px 16px;
  40. }
  41. h3 {
  42. margin: 0;
  43. font-size: 16px;
  44. font-weight: 500;
  45. line-height: 24px;
  46. color: var(--text-color);
  47. }
  48. // Крестик с псевдоэлементами
  49. &::before,
  50. &::after {
  51. content: '';
  52. position: absolute;
  53. right: 24px;
  54. top: 50%;
  55. width: 16px;
  56. height: 2px;
  57. background-color: var(--text-color);
  58. transition: transform 0.3s ease;
  59. }
  60. &::before {
  61. transform: translateY(-50%);
  62. }
  63. &::after {
  64. transform: translateY(-50%) rotate(90deg);
  65. }
  66. }
  67. &__number {
  68. display: flex;
  69. width: 32px;
  70. height: 32px;
  71. flex-direction: column;
  72. justify-content: center;
  73. align-items: center;
  74. gap: 10px;
  75. aspect-ratio: 1/1;
  76. font-weight: 600;
  77. background-color: var(--accent-color);
  78. color: var(--text-color);
  79. flex-shrink: 0;
  80. border-radius:50%;
  81. @include mobile{
  82. width:26px;
  83. height:26px;
  84. }
  85. }
  86. &__question-title {
  87. flex: 1;
  88. font-size: 16px;
  89. font-weight: 500;
  90. line-height: 24px;
  91. color: var(--text-color);
  92. }
  93. &__answer {
  94. max-height: 0;
  95. opacity: 0;
  96. overflow: hidden;
  97. transition: all 0.3s ease;
  98. border-top:1px dashed var(--content-border-color);
  99. p {
  100. margin: 0;
  101. font-size: 14px;
  102. line-height: 22px;
  103. color: var(--text-color);
  104. opacity: 0.8;
  105. }
  106. }
  107. &__answer-inner{
  108. padding: 24px;
  109. }
  110. }