/* PROFILE */

#user-profile {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1350px;
    margin: 30px auto 0px auto;
    /* margin-top: 65px; */
    padding: 50px 30px 20px 50px;
    gap: 30px;
    border-radius: 30px 30px 0px 0px;
    background: linear-gradient(to bottom, rgb(221 221 221), white);
}

#user-profile img {
    width: 150px;
    border-radius: 50%;
    box-shadow: 0px 0px 30px 20px rgba(0, 0, 0, 0.01)
}

#user-profile p {
    margin-top: 5px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    justify-self: flex-end;
    width: 100%;
    max-width: 400px;
}

#user-profile img {
  cursor: pointer;
  transition: 0.2s;
  width: 150px;
  height: 150px;
  object-fit: cover;
}

#user-profile img:hover {
  opacity: 0.8;
  transform: scale(0.98);
}

#edit-bio-btn {
    max-width: 160px;
    height: 40px;
    border-radius: 30px;
    font-size: 1em;
    background-color: rgb(196, 196, 196);
    cursor: pointer;
    border: none;
    padding: 10px 24px;
}

#bio-input {
    background-color: transparent;
    border: none;
    width: 100px;
    margin-top: 5px;
    font-size: 1em;
    width: 250px;
}

/* FEATURED PRODUCT */

#featured-banner {
    max-width: 1350px;
    padding: 40px 20px;
    margin: 0px auto;
}

.featured-banner-border {
    border: rgba(0, 0, 0, 0.171) 1px solid;
    border-radius: 15px;
    height: 300px;
}

#featured-banner h1 {
    padding: 20px;
}

/* FEATURED PRODUCT */

#user-profile-options {
    max-width: 1350px;
    margin: 0px auto;
    padding: 10px 50px 55px 50px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

#user-profile-options button {
    width: 100%;
    max-width: 160px;
    height: 40px;
    /* color: white; */
    border-radius: 30px;
    font-size: 1em;
    background-color: rgb(196, 196, 196);
    cursor: pointer;
    border: none;
    padding: 0px 24px;
}

#user-products-title {
    max-width: 1350px;
    margin: 0px auto;
    padding: 5px 30px 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


#products-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-template-rows: 335px;
    justify-items: center;
    max-width: 1350px;
    margin: 0px auto;
    justify-content: center;
    padding: 0px 30px;
}

.product-holder {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* width: 230px; */
    /* height: 100%; */
    padding: 23px;
}

.product-holder img {
    display: flex;
    flex-direction: row;
    align-self: center;
    width: 190px;
    height: 190px;
    object-fit: cover;
    border-radius: 15px;
}

.product-holder button {
    padding: 5px;
    background-color: rgb(196, 196, 196);
    border: none;
    color: black;
    border-radius: 15px;
    font-size: 1em;
    width: 100%;
}

.product-price {
    font-weight: 700;
}

#notif-btn {
  position: relative;
}

#notif-dot {
  display: none; /* hidden by default */
  position: absolute;
  top: 15px;
  left: 13px;
  width: 8px;
  height: 8px;
  background: red;
  border-radius: 50%;
}

.product-name-wrapper {
    /* Required for truncation */
    width: 100%; 
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    /* Margin reset */
    margin: 0 !important; 
    padding: 0;
}

.product-name {
    /* Required for consistency and margin reset */
    display: block; 
    width: 100%;
    margin: 0; 
    padding: 0;

    /* These are included for robustness */
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}

.error-msg {
    margin-top: 50px;
}

/* --- Global Truncation Helper Class --- */
/* Use this class on any block-level element that you want to truncate to a single line */
.truncate-single-line {
    white-space: nowrap; /* Prevent line breaks */
    overflow: hidden;    /* Hide anything that exceeds the container */
    text-overflow: ellipsis; /* Display "..." for truncated text */
    max-width: 100%; /* Ensure it respects the parent's width */
}


/* --- 1. Username Truncation --- */
/* Target the h1 element inside the profile info */
#user-profile .profile-info h1 {
    /* Set a max width if necessary (e.g., 200px) */
    max-width: 100%; 
    display: inline-block; /* Essential for single-line truncation to work on block elements */
    vertical-align: top; /* Align properly with other elements */
    
    /* Apply single-line truncation */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 2. Bio Text Truncation --- */
/* The bio element already has the ID 'bio-text' and will be given the class 'truncate-bio' */
/* We will define the bio truncation to limit it to 3 lines (adjust as needed) */
#bio-text {
    /* Limit the height to approximately 3 lines (e.g., 1.5em line-height * 3 lines) */
    max-height: 4.5em; /* Adjust based on your actual line-height */
    line-height: 1.5em; /* Define line height */
    overflow: hidden; /* Hide overflow */
    
    /* Multi-line truncation using WebKit/Blink prefix for most browsers */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; /* This sets the maximum number of lines */
    
    /* Optional: Ensure a smooth transition when loading */
    word-wrap: break-word;
}

/* Placeholder Card Styling */
.add-dummy-card {
    border: 2px dashed #ccc;
    background-color: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 20px 0px;
    border-radius: 10px;
}

.add-dummy-card:hover {
    background-color: #ededed;
    border-color: #999;
}

.dummy-link {
    text-decoration: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dummy-content {
    text-align: center;
    color: #888;
}

.plus-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.dummy-content p {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
}


/* ---------------------------------------------------------------- */
/* MEDIA QUERY FOR SMALL SCREENS (600px and under) */
/* ---------------------------------------------------------------- */
@media (max-width: 600px) {     
    .product-holder img {
        width: 140px;
        height: 140px;
    }
    .product-holder {
        width: 180px;
        height: 260px;
        padding: 10px 23px;
    }
    #products-section {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        grid-template-rows: 260px;
        gap: 10px;
        min-width: 370px;
    }
    #user-profile-options {
        padding: 10px 40px 35px 40px
    }
    #user-products-title {
        padding: 5px 30px 10px 30px;
    }
    #user-profile {
        padding: 45px 30px 25px 40px;
        gap: 15px;
        margin-top: 20px;
    }
}
