  .portfolio-item {
    position: relative;
    overflow: hidden;
  }

  .gallery-item-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 100%;
  }

  .gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
  }

  .gallery-img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  }

  .gallery-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    padding: 30px 10px 10px 10px;
    font-size: 12px;
    line-height: 1.3;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
  }

  .gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .gallery-modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 1000px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gallery-modal-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
  }

  .gallery-modal-description {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 8px;
    max-width: 80%;
    text-align: center;
    line-height: 1.5;
  }

  .gallery-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s;
  }

  .gallery-close:hover {
    color: #bbb;
  }

  .gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    padding: 16px;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    user-select: none;
    transition: background-color 0.3s;
    z-index: 10001;
  }

  .gallery-prev:hover, .gallery-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
  }

  .gallery-prev {
    left: 20px;
  }

  .gallery-next {
    right: 20px;
  }

  .gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
  }

  @media (max-width: 768px) {
    .gallery-prev, .gallery-next {
      font-size: 24px;
      padding: 12px;
    }

    .gallery-close {
      font-size: 32px;
      top: 10px;
      right: 20px;
    }

    .gallery-description {
      font-size: 11px;
      padding: 20px 8px 8px 8px;
      max-height: 50px;
    }

    .gallery-modal-description {
      font-size: 14px;
      padding: 12px 20px;
      bottom: 70px;
      max-width: 90%;
    }

    .gallery-modal-image {
      max-height: 65vh;
    }