@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --radius: 0.5rem;
  }
}

@layer components {
  .form-control {
    @apply w-full outline-none bg-transparent px-4 py-2 border border-[#F0E9E9] focus:border-main focus:right-2 focus:ring-main placeholder-secondary;
  }

  .btn {
    @apply px-8 py-2 text-white font-semibold rounded-md;
  }

  .btn-main {
    @apply bg-main border-2 border-transparent shadow-md hover:border-main hover:bg-white hover:text-main transition-all duration-300;
  }

  .btn-outline-black {
    @apply mt-1 block w-full p-2 rounded-md shadow-sm form-control border-[1.5px] placeholder-black border-black hover:border-main hover:bg-white hover:text-main transition-all duration-300;
  }

  .btn-main-outline {
    @apply bg-transparent border-2 text-main border-main shadow-md hover:bg-main hover:text-white transition-all duration-300;
  }

  .btn-btnColor {
    @apply bg-btnColor border-2 border-transparent shadow-md hover:border-btnColor hover:bg-white hover:text-btnColor transition-all duration-300;
  }

  .btn-btnColor-default {
    @apply bg-btnColor shadow-md hover:bg-btnColor/90 transition-all duration-300;
  }
}

/* handled scroll in select  */
html > body[data-scroll-locked] {
  overflow-y: visible !important;
  margin-right: 0 !important;
}

/*START ACTIVE FOR USER TAP */
/* Add this CSS for the custom underline using ::after */
.link-item {
  position: relative;
  color: #484848 !important;
}

.link-item.active {
  font-weight: 900;
}

.link-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  width: 80%;
  bottom: -10px;
  height: 2px;
  background-color: #12335d;
  /* Or your preferred color */
  transition: all 0.3s ease-in-out;
}

.link-item:hover::after {
  background-color: #12335d;
  /* Change to a hover color if needed */
}

/*END ACTIVE FOR USER TAP */

.slick-dots li button:before {
  font-size: 10px;
}

.slick-next,
.slick-prev {
  z-index: 2;
  border: inherit;
  border-color: white;
}

#mainSlider .slick-prev::before,
#mainSlider .slick-next::before {
  display: none;
}

#mainSlider .slick-dots li button:before {
  color: white;
}

#mainSlider .slick-dots li.slick-active button:before {
  content: "";
  width: 30px;
  height: 10px;
  background-color: white;
  opacity: 1;
  border-radius: 5px;
  transform: translateY(50%);
}

@media (min-width: 1024px) {
  #mainSlider .slick-dots {
    width: fit-content;
    bottom: 20px;
    left: 50px;
  }
}

.brandsSlider .slick-dots li.slick-active button:before {
  @apply bg-main;
  content: "";
  width: 30px;
  height: 10px;
  opacity: 1;
  border-radius: 5px;
  transform: translateY(50%);
}

.brandsSlider ul.slick-dots {
  margin-top: 1rem;
  position: static;
}

.saleSlider .slick-prev::before,
.saleSlider .slick-next::before {
  display: none;
}

/*END ACTIVE FOR USER TAP */

/* 
Author: Ahmed Badran
Description: Update style on react-phone-number-input
Created at: 21/10/2024
*/
.PhoneInputInput {
  width: 100%;
  height: 2.5rem;
  border-width: 1px;
  border-radius: calc(var(--radius) - 2px);
}

#personal-details-mobile > .PhoneInput > .PhoneInputCountry {
  border: 1px solid #2e2e2e;
  border-radius: calc(var(--radius) - 2px);
  background-color: #ffffff;
  width: 70px;
  margin-right: 0;
}

/* Mohammed Hossam */
#countryInput > .PhoneInput > .PhoneInputInput {
  background-color: transparent !important;
  border: none !important;
  width: 200px !important;
}

.PhoneInputInput:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0
    var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0
    calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow),
    var(--tw-shadow, 0 0 #0000);
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(0 142 204 / var(--tw-ring-opacity));
  --tw-ring-offset-width: 2px;
}

#personal-details-mobile > .PhoneInput > .PhoneInputInput {
  border: 1px solid #2e2e2e;
}

#personal-details-mobile > .PhoneInput > .PhoneInputInput:focus-visible {
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(46 46 46 / var(--tw-ring-opacity));
}

#personal-details-mobile > .PhoneInput > .PhoneInputCountry {
  width: 70px;
}

#shipping-address-country > .PhoneInput > .PhoneInputInput {
  display: none;
}

#shipping-address-country > .PhoneInput > .PhoneInputCountry {
  width: 100%;
}

.PhoneInputCountryIcon {
  margin-inline-start: 1rem;
  margin-inline-end: 1rem;
}

@media (min-width: 768px) {
  .PhoneInputInput {
    height: 3rem;
    /* 40px */
  }

  .PhoneInputCountry {
    height: 3rem;
  }

  #personal-details-mobile > .PhoneInput > .PhoneInputCountry {
    width: 100px;
    gap: 12px;
  }
}

table {
  border-collapse: separate;
  border-spacing: 0 12px !important;
  /* Only adds vertical spacing */
}

table tr + tr {
  /* Apply spacing only to rows that follow another row */
  margin-top: 12px !important;
}

.no-row-space {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  /* Only adds vertical spacing */
}

/* End */
/* style image gallery */
.image-gallery-left-nav .image-gallery-svg,
.image-gallery-right-nav .image-gallery-svg {
  height: 60px;
  width: 30px;
}

.image-gallery-content .image-gallery-slide .image-gallery-image {
  max-height: 60vh;
}

/* Print-specific styles */
@media print {
  /* Hide navigation bar and footer when printing */
  nav,
  footer {
    display: none !important;
  }

  /* Ensure the print page content takes full width */
  body,
  html {
    width: 100%;
    margin: 0;
    padding: 0;
    margin: 0 !important;
    padding: 5px !important;
  }

  /* Ensure the main content is properly printed */
  .container {
    width: 100%;
    margin: 0;
    padding: 0;
  }
}

.image-gallery-icon {
  color: #353535;
  box-shadow: none;
}

@media (min-width: 1024px) {
  .image-gallery-left-nav {
    left: 35px;
  }

  .image-gallery-right-nav {
    right: 35px;
  }
}

.image-gallery-content .image-gallery-slide .image-gallery-image {
  height: 60vh;
}

.image-gallery-thumbnail .image-gallery-thumbnail-image {
  height: 70px;
  object-fit: contain;
}

/* start of scroll bars  */
/* for browsers that don't support ::-webkit-scrollbar */
/* Style the entire scrollbar */
::-webkit-scrollbar {
  width: 10px;
  /* Width of the scrollbar */
  height: 10px;
  /* Height of the scrollbar */
}

/* Style the scrollbar track */
::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 10px;
}

/* Style the scrollbar thumb */
::-webkit-scrollbar-thumb {
  @apply bg-main;
  border-radius: 10px;
  border: 2px solid #f0f0f0;
  /* Space around the thumb */
}

/* end of scroll bars  */

/* start of  loader  */
/* HTML: <div class="loader"></div> */
.loader {
  width: 40px;
  height: 60px;
  position: relative;
}

.loader::before,
.loader::after {
  content: "";
  position: absolute;
  inset: 0;
  @apply bg-main;
  /* Replace `main` with your desired Tailwind color */
  clip-path: polygon(0 0, 100% 0, 100% 67%, 50% 67%, 50% 34%, 0 34%);
  animation: sp7 2s infinite;
}

.loader::after {
  --s: -1, -1;
}

@keyframes sp7 {
  0%,
  10% {
    transform: scale(var(--s, 1)) translate(0, 0) rotate(0deg);
  }

  33% {
    transform: scale(var(--s, 1)) translate(0, -20px) rotate(0deg);
  }

  66% {
    transform: scale(var(--s, 1)) translate(10px, -20px) rotate(-90deg);
  }

  90%,
  100% {
    transform: scale(var(--s, 1)) translate(10px, -10px) rotate(-90deg);
  }
}

/* end of  loader  */

.image-gallery.fullscreen-modal {
  opacity: 0.9;
}

.image-gallery-index {
  @apply bg-main;
  border-radius: 7px;
  opacity: 0.6;
}

/* start of table for single product description */

.attribute-layout h2 {
  font-weight: 700;
  font-size: 20px;
  color: #222;
  line-height: 26px;
}

.attribute-layout .attribute-info h3 {
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 20px;
}

.attribute-layout .attribute-list {
  display: table;
  border-collapse: collapse;
}

.attribute-layout .attribute-list .attribute-item {
  display: table-row;
  border: 1px solid #ddd;
}

.attribute-layout .attribute-list .attribute-item > div.left {
  width: 320px;
  background: #f4f4f4;
}

.attribute-layout .attribute-list .attribute-item > div {
  padding: 12px;
  font-weight: 400;
  font-size: 16px;
  color: #222;
  line-height: 22px;
  display: table-cell;
  border: 1px solid #ddd;
}

.attribute-layout .attribute-list .attribute-item > div.right {
  width: 420px;
}

.attribute-layout .attribute-list .attribute-item > div {
  padding: 12px;
  font-weight: 400;
  font-size: 16px;
  color: #222;
  line-height: 22px;
  display: table-cell;
  border: 1px solid #ddd;
}

.attribute-layout .attribute-list .attribute-item > div.right span {
  font-weight: 500;
  font-size: 16px;
  color: #222;
  line-height: 22px;
}

.attribute-layout .attribute-info h3 {
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 20px;
}

.attribute-layout .attribute-list {
  display: table;
  border-collapse: collapse;
}

.attribute-layout .attribute-info h3 {
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 20px;
}

.attribute-layout .attribute-list {
  display: table;
  border-collapse: collapse;
}

.attribute-layout .attribute-list .attribute-item {
  display: table-row;
  border: 1px solid #ddd;
}

.attribute-layout .attribute-list .attribute-item > div {
  padding: 12px;
  font-weight: 400;
  font-size: 16px;
  color: #222;
  line-height: 22px;
  display: table-cell;
  border: 1px solid #ddd;
}

.attribute-layout .attribute-list .attribute-item > div.left {
  width: 320px;
  background: #f4f4f4;
}

.attribute-layout .attribute-list .attribute-item > div.right {
  width: 420px;
}

.attribute-layout .attribute-list .attribute-item > div.right span {
  font-weight: 500;
  font-size: 16px;
  color: #222;
  line-height: 22px;
}

/* end of table for single product description */
/* START LOADER 4 */
/* From Uiverse.io by alexruix */
.loader4 {
  width: 48px;
  height: 48px;
  margin: auto;
  position: relative;
}

loader .loader4:before {
  content: "";
  width: 48px;
  height: 5px;
  @apply bg-main;
  /* Replace `main` with your desired Tailwind color */
  position: absolute;
  top: 60px;
  left: 0;
  border-radius: 50%;
  animation: shadow324 0.5s linear infinite;
}

.loader4:after {
  content: "";
  width: 100%;
  height: 100%;
  @apply bg-main;
  /* Replace `main` with your desired Tailwind color */
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 4px;
  animation: jump7456 0.5s linear infinite;
}

@keyframes jump7456 {
  15% {
    border-bottom-right-radius: 3px;
  }

  25% {
    transform: translateY(9px) rotate(22.5deg);
  }

  50% {
    transform: translateY(18px) scale(1, 0.9) rotate(45deg);
    border-bottom-right-radius: 40px;
  }

  75% {
    transform: translateY(9px) rotate(67.5deg);
  }

  100% {
    transform: translateY(0) rotate(90deg);
  }
}

@keyframes shadow324 {
  0%,
  100% {
    transform: scale(1, 1);
  }

  50% {
    transform: scale(1.2, 1);
  }
}

/* END LOADER 4 */

/* START LOADER 5 */
.spinner {
  --gap: 6px;
  /* gap between each circle */
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--gap);
}

.spinner span {
  width: 20px;
  height: 20px;
  border-radius: 100%;
  @apply bg-main;
  opacity: 0;
}

.spinner span:nth-child(1) {
  animation: fade 1s ease-in-out infinite;
}

.spinner span:nth-child(2) {
  animation: fade 1s ease-in-out 0.33s infinite;
}

.spinner span:nth-child(3) {
  animation: fade 1s ease-in-out 0.66s infinite;
}

@keyframes fade {
  0%,
  100% {
    opacity: 1;
  }

  60% {
    opacity: 0;
  }
}

/* END LOADER 5 */
/* START LOADER 6 */
.loader6 {
  display: flex;
}

.loader6 .dot {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  border: 2px solid #e8e8e8;
  @apply bg-main;
  animation: jump 0.8s ease-in-out infinite alternate;
}

@keyframes jump {
  100% {
    background: #661e92;
    transform: translateZ(-3rem) scale(1.9);
  }
}

.loader6 .dot:nth-child(1) {
  animation-delay: 0.1s;
}

.loader6 .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loader6 .dot:nth-child(3) {
  animation-delay: 0.3s;
}

.loader6 .dot:nth-child(4) {
  animation-delay: 0.4s;
}

.loader6 .dot:nth-child(5) {
  animation-delay: 0.5s;
}

/* END LOADER 6 */
@keyframes customPulse {
  50% {
    opacity: 0.8;
  }
}

.animate-move {
  animation: singleProductButton 1s linear alternate infinite,
    customPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes singleProductButton {
  0% {
    transform: translateX(0);
  }

  10% {
    transform: translateX(-5px);
  }

  20% {
    transform: translateX(5px);
  }

  30% {
    transform: translateX(0);
  }
}

@keyframes layout-transition {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.95);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-layout-transition {
  animation: layout-transition 0.7s ease-in-out;
}

.product-card-container {
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.animate-fade-in-out {
  animation: fadeInOut 2s ease-in-out infinite;
}

/* Alternative: Separate fade in and fade out with pause */
@keyframes fadeInOutWithPause {
  0% {
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.animate-fade-with-pause {
  animation: fadeInOutWithPause 3s ease-in-out infinite;
}

/* Staggered animation for visual interest */
.animate-fade-in-out:nth-child(1) {
  animation-delay: 0s;
}

.animate-fade-in-out:nth-child(2) {
  animation-delay: 0.2s;
}
