@import url('https://fonts.googleapis.com/css2?family=Afacad:wght@400;600;700&display=swap');

@font-face {
  font-family: "Afacad";
  src: url("../assets/Afacad[wght].ttf") format("truetype");
  font-weight: 400 700; 
  font-style: normal;
  font-display: swap; 
}

@font-face {
  font-family: "Bauhaus 93";
  src: url("../assets/Bauhaus 93 Regular.ttf") format("truetype"); /* កែតម្រូវ Space ក្នុងឈ្មោះ File */
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Variables (រក្សាពណ៌ដើម) --- */
:root {
  --color-primary: #002d6d;
  --color-secondary: #e5f5ff;
  --color-accent: #0282fe;
  --color-accent-dark: #0057d3;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-border: #b4dafc;
      
  --font-body: "Afacad", sans-serif;
  --font-bold: "Afacad", sans-serif;
  --font-semibold: "Afacad", sans-serif;
  --font-logo: "Bauhaus 93", sans-serif;
}

/*======================================================================================================================================*/

/* ----------------------------------- */
/* --------search-bar header----------- */
/* ----------------------------------- */

.search-icon-mobile {
  display: none; /* លាក់ Icon ប៊ូតុងនៅ Desktop */
}

/* --- Static Search Bar (Always Open - 400px) --- */
.header-main .search-bar-full {
  height: 40px;
  background-color: var(--color-search-bg);
  border: 2px solid var(--color-primary);
  border-radius: 25px;
  
  /* --- បង្ខំឱ្យធំជានិច្ច --- */
  width: 400px !important; 
  display: flex;
  align-items: center;
  justify-content: flex-start; /* តម្រឹមទៅឆ្វេង */
  padding: 0 15px;
  cursor: text;
  transition: border-color 0.3s ease;
}

/* បង្ខំឱ្យបង្ហាញ Input ជានិច្ច */
.header-main .search-bar-full .search-input-haader {
  width: 100% !important; 
  opacity: 1 !important;
  padding-left: 10px;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--color-primary);
  background: transparent;
  pointer-events: auto;
}

.header-main .search-bar-full .search-icon-haader {
  font-size: 20px;
  color: var(--color-primary);
  margin-right: 0;
  flex-shrink: 0;
}

/* Hover Effect */
.header-main .search-bar-full:hover {
  border-color: var(--color-accent);
}

/* ----------------------------------- */
/* -------ចប់ search-bar header-------- */
/* ----------------------------------- */


.main-banner {
  margin-top: 120px;
  padding: 0 150px;
  height: 550px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: url(main-banner1.png) center;
  background-size: cover;
  background-repeat: no-repeat;
  position: relative; /* <-- បានបន្ថែម position relative សម្រាប់ Overlay */
}

.banner-content {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start; 
  text-align: left;
  flex: 1;
  position: relative; /* <-- កែត្រង់នេះ (សម្រាប់ z-index) */
  z-index: 2;         /* <-- កែត្រង់នេះ (សម្រាប់ z-index) */
}

.banner-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.banner-welcome {
  font-size: 47px;
  font-weight: 700;
  font-family: var(--font-bold);
  text-transform: uppercase;
}

.banner-brand {
  font-family: var(--font-logo); 
  font-size: 100px;
  line-height: 1;
}

.banner-brand .brand-free {
  color: var(--color-primary);
}

.banner-brand .brand-srock {
  color: var(--color-accent);
}

.banner-description {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 24px; 
  max-width: 800px;
}
    
/* --------------------------------- */
/* --- Keyframes សម្រាប់ចលនា --- */
/* --------------------------------- */
.banner-graphics {
  width: 600px; 
  height: 550px; 
  position: relative;
  flex-shrink: 0;
  z-index: 2; /* <-- កែត្រង់នេះ (សម្រាប់ z-index) */
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(5px, 8px); } /* បង្កើនគម្លាត */
  50% { transform: translate(0, 0); }
  75% { transform: translate(-5px, -8px); } /* បង្កើនគម្លាត */
}
    
@keyframes float-2 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-8px, 5px); } /* បង្កើនគម្លាត */
  50% { transform: translate(0, 0); }
  75% { transform: translate(8px, -5px); } /* បង្កើនគម្លាត */
}
    
.banner-graphics .graphic-1 {
  width: 38.3%;
  height: 49.64%;
  position: absolute;
  right: 30.87%;
  left: 30.83%;
  bottom: 25.3%;
  top: 25.07%;
}

.banner-graphics .graphic-2 {
  width: 16.42%; 
  height: 17.91%; 
  position: absolute; 
  right: 74.58%; 
  left: 9%; 
  bottom: 71.92%; 
  top: 10.17%; 
  object-fit: cover;
  animation: float-1 4s ease-in-out infinite alternate; /* បន្ថែមល្បឿន*/
}

.banner-graphics .graphic-3 {
  width: 31.83%; 
  height: 34.73%; 
  position: absolute; 
  right: -4.67%; 
  left: 72.83%; 
  bottom: 64.38%; 
  top: 0.89%; 
  object-fit: cover;
  animation: float-2 5s ease-in-out infinite alternate; /* បន្ថែមល្បឿន*/
}

.banner-graphics .graphic-4 {
  width: 226px; 
  height: 226px; 
  position: absolute; 
  left: -31px; bottom: 
  0px; object-fit: cover;
  animation: float-1 6s ease-in-out infinite alternate; /* បន្ថែមល្បឿន*/
}

.banner-graphics .graphic-5 {
  width: 24.33%; 
  height: 26.55%; 
  position: absolute; 
  right: 3.83%; 
  left: 71.83%; 
  bottom: 10.18%; 
  top: 63.27%; 
  object-fit: cover;
  animation: float-2 3s ease-in-out infinite alternate; /* បន្ថែមល្បឿន*/
}

/* --------------------------------------------------------------------------------------------------*/
/* --- Ad Banner (PC) --- */
.ad-banner {
  padding: 20px 500px;
  width: 100%;
  }
    
.ad-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------------------------------*/
/* --- Content Section (PC) --- */
.content-section {
  padding: 20px 150px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 42px;
  font-family: var(--font-bold);
  font-weight: 600;
  color: var(--color-text); /* <-- កែឲ្យប្រើสี Theme */
}
    
.see-more-btn {
  background: linear-gradient(103.15deg, #0282fe 0%, #0057d3 100%);
  border-radius: 7px;
  padding: 10px 20px;
  font-size: 24px;
  font-family: var(--font-bold);
  color: var(--color-white);
  cursor: pointer;
  transition: filter 0.3s ease, transform 0.3s ease;
}
    
/* --- Hover Effect --- */
.see-more-btn:hover {
  filter: brightness(1.15); /* ធ្វើអោយភ្លឺជាងមុន */
  transform: scale(1.02); /* ពង្រីកបន្តិច */
}

/* --------------------------------- */
/* --- Image list Grid Layout --- */
/* --------------------------------- */
.item-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); 
  gap: 20px;
}

.product-card {
  background: var(--color-header-bg); /* <-- កែត្រង់នេះ */
  border-radius: 20px; 
  overflow: hidden;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  /* ▼▼▼ កែត្រង់នេះ ▼▼▼ */
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
    
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.3s ease;
}
    
.product-card:hover {
  transform: translateY(-8px); 
  box-shadow: 0 10px 20px rgba(0, 45, 109, 0.15); 
}

html[data-theme="dark"] .product-card:hover {
    box-shadow: 0 10px 20px rgba(2, 130, 254, 0.1); /* ស្រមោលสีខៀវពេល Dark Mode */
}
    
.product-card:hover .card-image {
  filter: brightness(0.7); 
}
    
.card-overlay, .card-tag-free {
  opacity: 0;
  transition: opacity 0.3s ease;
}
    
.product-card:hover .card-overlay,
.product-card:hover .card-tag-free {
  opacity: 1;
}
    
.card-overlay {
  position: absolute;
  bottom: 15px; 
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  width: 214px; 
}

.download-btn {
  background: linear-gradient(103.15deg, #0282fe 0%, #0057d3 100%);
  border-radius: 7px; 
  padding: 10px 20px; 
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px; 
  box-shadow: inset -1.95px 1.95px 2.59px 0px rgba(25, 209, 255, 0.5), inset 1.95px -1.95px 2.59px 0px rgba(69, 92, 133, 0.5);
}

.download-btn:hover {
  background: linear-gradient(103.15deg, #2599ff 0%, #2599ff 100%);
}
    
.download-icon {
  width: 11.68px; 
  height: 11.03px; 
}
    
.download-text {
  color: var(--color-white);
  font-family: var(--font-bold);
  font-size: 15.57px; 
  white-space: nowrap; 
}

.card-tag-free {
  position: absolute;
  top: 12px; 
  left: 12px;
}
    
.free-text-container {
  background: var(--color-accent);
  border-radius: 7px; 
  padding: 5px 10px;
}

.free-text {
  color: var(--color-white);
  font-size: 12px;
}

@media (max-width: 1400px) {
  .item-grid {
    grid-template-columns: repeat(4, 1fr); 
  }

  .ad-banner {
    padding: 50px 300px;
  }
}

/*======================================================================================================================================*/
/* ===== Tablet Styles (max-width: 1199px) ===== */
@media (max-width: 1199px) {

  /* លាក់ Search Bar ពេញលេញនៅពេលអេក្រង់តូច */
  .header-main .search-bar-full {
    display: none;
  }
            
  /* បង្ហាញ Search Icon រាងជ្រុងមូល */
  .search-icon-mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--header-control-height);
    height: var(--header-control-height);
    background-color: var(--color-search-bg);
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .search-icon-mobile:hover {
    background-color: var(--color-primary);
    transition: scale(1.05);
  }

  /* រូបសញ្ញាស្វែងរកខាងក្នុងប្រអប់ */
  .search-icon-mobile svg {
    color: var(--color-primary);
    font-size: 20px;
    width: 20px;
    height: 20px;
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
  }

  .search-icon-mobile:hover svg {
    color: var(--color-bg);
    stroke: var(--color-bg);
  }

  .main-banner {
    margin-top: 140px;
    padding: 0 50px;
    height: 365.75px;
  }

  .banner-description {
    font-size: 24px;
    max-width: none;
  }
      
  .banner-graphics {
    width: 399px;
    height: 365.75px;
  }

  .banner-graphics .graphic-1 {
    width: 38.3%;
    height: 49.64%;
    right: 30.87%;
    left: 30.83%;
    bottom: 25.3%;
    top: 25.07%;
  }

  .banner-graphics .graphic-2 {
    width: 16.42%;
    height: 17.91%;
    right: 74.58%;
    left: 9%;
    bottom: 71.92%;
    top: 10.17%;
  }

  .banner-graphics .graphic-3 {
    width: 31.83%;
    height: 34.73%;
    right: -4.67%;
    left: 72.83%;
    bottom: 64.38%;
    top: 0.89%;
  }

  .banner-graphics .graphic-4 {
    width: 150.29px;
    height: 150.29px;
    left: -20.61px;
    bottom: 0px;
  }

  .banner-graphics .graphic-5 {
    width: 24.33%;
    height: 26.55%;
    right: 3.83%;
    left: 71.83%;
    bottom: 10.18%;
    top: 63.27%;
  }

  .banner-welcome { font-size: 40px; }
  .banner-brand { font-size: 60px; }

  .ad-banner { padding: 20px 100px; }
  .content-section { padding: 50px; }
  .section-title { font-size: 47px; }

  .item-grid {
    grid-template-columns: repeat(3, 1fr); 
  }
}


/*======================================================================================================================================*/   
/* ===== Mobile Styles (max-width: 767px) ===== */
@media (max-width: 767px){

  .main-banner {
    margin-top: 100px;
    padding: 30px 20px;
    height: auto; 
    flex-direction: column;
    gap: 21px;
  }

  .banner-content { 
    align-items: center; 
    text-align: center; 
  }

  .banner-welcome { font-size: 30px; }
  .banner-brand { font-size: 40px; }
  .banner-description { font-size: 16px; }

  .banner-graphics {
    width: 100%;
    max-width: 399px;
    height: 280px;
  }

  .banner-graphics .graphic-1 {
    width: 33.75%;
    height: 57.14%;
    right: 33.14%;
    left: 33.11%;
    bottom: 21.54%;
    top: 21.31%;
  }

  .banner-graphics .graphic-2 {
    width: 16.42%;
    height: 23.39%;
    right: 75.08%;
    left: 8.5%;
    bottom: 75.25%;
    top: 1.36%;
  }

  .banner-graphics .graphic-3 {
    width: 31.83%;
    height: 45.36%;
    right: -4.67%;
    left: 72.83%;
    bottom: 59.06%;
    top: -4.43%;
  }

  .banner-graphics .graphic-4 {
    width: 150.29px;
    height: 150.29px;
    left: -20.62px;
    bottom: 0.25px;
  }

  .banner-graphics .graphic-5 {
    width: 24.33%;
    height: 34.67%;
    right: 3.83%;
    left: 71.83%;
    bottom: 6.12%;
    top: 59.21%;
  }

  .ad-banner { padding: 20px; }
  .content-section { padding: 20px; }
  .section-title { font-size: 32px; }

  .item-grid {
    grid-template-columns: repeat(2, 1fr); 
  }
}