/* Prevent body scroll when modal is open */
body.cg-modal-open {
  overflow: hidden;
  /* height: 100vh; */
}

/* Top Bar with Tabs and Filter */
.cg-topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.cg-tabs {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.cg-tabs button {
  padding: 0.5rem;
  border: 0;
  background: #ecf0f8;
  color: #293f71;
  cursor: pointer;
  border-radius: 1.875rem;
  font-size: 0.75rem;
  font-weight: 400;
  font-family: inherit;
  line-height: 0.75rem;
}

.cg-tabs button.active {
  background-color: #293f71;
  color: #f9fafd;
}
.cg-tab:focus {
  outline: none;
}
/* Custom Dropdown Styles */
.cg-dropdown {
  position: relative;
  width: 192px;
}

.cg-dropdown-btn {
  width: 100%;
  padding: 8px 16px 12px 16px;
  border: 0.0625rem solid #cdd7ed;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  color: #293f71;
  background: #fff;
  height: 50px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  position: relative;
  padding-right: 32px;
}
.cg-dropdown-btn:focus {
  outline: none;
}
.cg-dropdown-btn::after {
  content: "▼";
  position: absolute;
  right: 12px;
  top: 42%;
  transform: translateY(-42%);
  font-size: 8px;
  color: #b4c3e4;
  transition: transform 0.3s ease;
}

.cg-dropdown.open .cg-dropdown-btn::after {
  transform: translateY(-50%) rotate(180deg);
}
.cg-dropdown.open .cg-dropdown-btn {
  border-radius: 4px 4px 0 0;
  z-index: 1003;
}

.cg-dropdown-value,
.cg-dropdown-label {
  color: #b4c3e4;
  font-weight: 400;
}

.cg-dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  margin-top: -0.0625rem;
  border: 0.0625rem solid #d9dfea;
  border-radius: 0 0 4px 4px;
  box-shadow: -2px -2px 51px 16px #e1e1e1;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1002;
  padding: 10px 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.cg-dropdown.open .cg-dropdown-list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.cg-dropdown-item {
  padding: 7px 0;
  cursor: pointer;
  font-size: 14px;
  color: #293f71;
  transition: background-color 0.2s ease;
}

.cg-dropdown-item:hover {
  color: #008af7;
  text-decoration: none;
}

.cg-dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff9;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.cg-dropdown-overlay.active {
  opacity: 1;
  visibility: visible;
}

.cg-filter {
  padding: 8px 16px;
  border: 0.0625rem solid #cdd7ed;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  color: #b4c3e4;
  background: #fff;
  width: 192px;
  height: 40px;
}

.cg-spacer {
  flex: 1;
}
@media screen and (min-width: 1140px) {
  .cg-tabs button {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
    line-height: 1.5rem;
  }
}
/* Gallery Grid */
.cg-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 40px 34px;
}

/* Card Styling */
.cg-card {
  padding: 0;
  position: relative;
}

.cg-imgwrap {
  position: relative;
  display: inline-block;
}

.cg-imgwrap img {
  width: 100%;
  display: block;
  border: 0.0625rem solid #e8e8e8;
  border-radius: 4px;
}

.cg-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  cursor: pointer;
  border: 0;
  background-color: #f1f8fe;
  height: 38px;
  position: absolute;
  right: 10px;
  text-align: center;
  top: 10px;
  width: 40px;
  z-index: 2;
}
.cg-zoom:focus {
  outline: none;
}
.cg-title {
  font-weight: 500;
  font-size: 26px;
  margin-top: 24px;
  margin-bottom: 20px;
  color: #233143;
  line-height: 39px;
}
.cg-subtitle {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
}

/* Color Picker Buttons */
.cg-colors {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.cg-colorbtn {
  height: 32px;
  width: 32px;
  border: 0;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
}
.cg-colorbtn.active {
  box-shadow: 0 0.7rem 1.3rem #0000003b;
  border: 3px solid #fff;
}
.cg-colorbtn:focus {
  outline: none;
}

.cg-colorbtn.active:after {
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  display: block;
  height: 9px;
  left: 10px;
  position: absolute;
  top: 5px;
  transform: rotate(45deg);
  width: 5px;
}

[data-color="blu"] {
  background-color: #002e58;
}

[data-color="nero"] {
  background-color: #373d48;
}

[data-color="grigio"] {
  background-color: #576d7b;
}

[data-color="rosso"] {
  background-color: #d0021b;
}

[data-color="azzurro"] {
  background-color: #2a689a;
}

[data-color="turchese"] {
  background-color: #39c3b1;
}

[data-color="verde"] {
  background-color: #00494d;
}
.cg-cta {
  outline: none;
  font-weight: 600;
  background: #a31818;
  border: 0.0625rem solid #a71f1f;
  color: #fff;
  border-radius: 32px;
  font-size: 16px;
  padding: 15px 25px 13px;
  max-width: 250px;
  width: 100%;
  text-transform: uppercase;
  cursor: pointer;
}
.cg-cta:not(.cg-modal-cta) {
  bottom: 2rem;
  left: 50%;
  opacity: 0;
  position: absolute;
  outline: none;
  transform: translateX(-50%);
  z-index: 1;
}
.cg-imgwrap:hover .cg-cta {
  opacity: 1;
}
.cg-cta:hover {
  background: #d04141;
  border-color: #d04141;
  color: #fff;
}
.cg-cta:focus {
  box-shadow: 0 4px 40px -5px #a31818;
  color: #fff;
  outline: none;
}
.cg-cta.cg-modal-cta {
  margin: 16px auto;
  display: inline-block;
  text-align: center;
}
/* Modal Popup */
.cg-modal {
  display: none;
  background-color: rgba(0, 0, 0, 0.7);
  inset: 0;
  padding: 19px 44px;
  position: fixed;
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}

@media only screen and (max-width: 767px) {
  .cg-modal {
    padding: 0;
    align-items: flex-start;
  }
}

.cg-modal-title {
  color: #fff;
  font-size: 36px;
  font-weight: 600;
  line-height: 54px;
  text-align: center;
  margin-bottom: 4px;
}

@media only screen and (max-width: 767px) {
  .cg-modal-title {
    font-size: 30px;
    line-height: 45px;
    margin-bottom: 20px;
  }
}

.cg-modal-inner {
  width: 100%;
  max-width: 475px;
  margin: 0 auto;
}

@media only screen and (max-width: 767px) {
  .cg-modal-inner {
    /* max-width: 303px; */
    padding: 118px 44px 0 44px;
  }
}

.cg-modal-close {
border: none;
  align-items: center;
    background-color: #f1f8fe;
    border-radius: .25rem;
    cursor: pointer;
    display: flex;
    height: 2.375rem;
    position: absolute;
    right: -1.25rem;
    width: 2.375rem;
}
.cg-modal-close:after,
.cg-modal-close:before {
  background-color: #005290;
  border-radius: .125rem;
  content: " ";
  height: 0.9375rem;
  left: 1.125rem;
  position: absolute;
  width: .125rem;
}
.cg-modal-close:before {
  transform: rotate(45deg);
}
.cg-modal-close:after {
  transform: rotate(-45deg);
}

@media only screen and (max-width: 767px) {
  .cg-modal-close {
    top: 1.5rem;
    right: 1rem;
    background-color: rgba(241, 248, 254, 0.95);
  }
}

.cg-modal-close:hover {
  background-color: #dce9f7;
  color: #000;
}

.cg-modal-close:focus {
  outline: none;
}

.cg-modal-content {
  position: relative;
  text-align: center;
}

@media only screen and (max-width: 767px) {
  .cg-modal-content {
    max-width: 30.3rem;
  }
}
/* Slider */
.cg-slider {
  position: relative;
  margin-bottom: 24px;
  border-radius: 8px;
  background: #f5f5f5;
}

.cg-slide {
  display: none;
  text-align: center;
}

.cg-slide.active {
  display: block;
}

.cg-slide img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  max-width: 475px;
}

.cg-next,
.cg-prev {
  background-color: #054bbb;
  cursor: pointer;
  height: 41px;
  position: absolute;
  top: 50%;
  transform: rotate(-45deg);
  width: 41px;
  z-index: 1;
  border: none;
}

.next-icon {
  border: solid #fff;
  border-width: 0 3px 3px 0;
  display: inline-block;
  height: 13px;
  pointer-events: none;
  position: relative;
  width: 13px;
  z-index: 2;
}
.prev-icon {
  border: solid #fff;
  border-width: 0 3px 3px 0;
  display: inline-block;
  height: 13px;
  pointer-events: none;
  position: relative;
  width: 13px;
  z-index: 2;
  transform: rotate(180deg);
}

.cg-prev:hover,
.cg-next:hover {
  background: #054bbb;
}

.cg-prev:focus,
.cg-next:focus {
  outline: none;
}

.cg-prev:disabled,
.cg-next:disabled {
  background-color: #e1ecfe;
  cursor: not-allowed !important;
  /* pointer-events: none; */
}

.cg-prev {
  left: -21px;
}

.cg-next {
  right: -21px;
}

/* Modal Color Buttons */
.modal-colors {
  position: absolute;
  justify-content: center;
  bottom: 150px;
  display: flex;
  width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
  .cg-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    padding: 0 20px;
  }
  .cg-title {
    font-size: 26px;
  }
  .cg-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .cg-spacer {
    display: none;
  }

  .cg-dropdown {
    width: 100%;
  }
}

@media only screen and (min-width: 768px) {
  .cg-modal-close {
    /* top: 40px; */
    right: 4.3125rem;
  }
}
