* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* Global tags*/
a {
    text-decoration: none;
}
ul {
    list-style: none;
}
img {
    max-width: 100%;
    object-fit: cover;
    height: auto;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: white;
    padding: 15px 20px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.header-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #a0a0a0;
    font-weight: 500;
    margin-left: 60px; 
}

.header-text img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.signup-btn {
    background: transparent;
    border: 1px solid #a385f0;
    color: #a385f0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.signup-btn:hover {
    background: #a385f0;
    color: white;
}

.login-btn {
    background: #a385f0;
    border: none;
    color: white;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.logout-btn {
    background: red;
    border: none;
    color: white;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.logout-btn:hover {
    background: rgb(158, 6, 6);
}

.login-btn:hover {
    background: #8d6ee8;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 100vh;
    background-color: #1a1a1a;
    z-index: 1000;
}

.sidebar-inner {
    background-color: white;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 15px;
}

.sidebar-logo {
    align-content: center;
    text-align: center;
    width: 35px;
    height: 35px;
    margin-bottom: 20px;
    font-size: 1.5em
}


.sidebar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

/* Active button in the sidebar */
.active {
    background-color: #7a3de3;
    color: white;
}

.sidebar-btn img {
    width: 28px;
    height: 28px;
    opacity: 0.7;
    transition: 0.3s;
}

.sidebar-btn:hover img {
    opacity: 1;
}

/* Search and Cart Container */
.search-cart-container {
    display: flex;
    align-items: center;
    background-color: #f4f7fe; 
    padding: 20px;
    margin-left: 60px; 
    width: calc(100% - 60px);
    margin-top: 60px; 
}

.search-container {
    flex-grow: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
}

.search-container input {
    border: none;
    outline: none;
    padding: 10px 15px;
    width: 100%;
    font-size: 14px;
}

.search-container button {
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #8a4dff;
    font-size: 16px;
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #8a4dff;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: 20px;
}

.cart-btn:hover {
    background: #7a3de3;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
  text-align: center;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

.modal-content h2 {
  margin-bottom: 20px;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-content input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.modal-content button {
  padding: 10px;
  background-color: #9C89FF;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.modal-content button:hover {
  background-color: #8073C5;
}

.modal-content p {
  margin-top: 10px;
}

.modal-content a {
  color: #9C89FF;
  cursor: pointer;
}

.modal-content a:hover {
  text-decoration: underline;
}

/* Main Container */
.main-container {
    display: flex;
    margin-left: 60px; 
    gap: 20px; 
    background-color: #f4f7fe;
    padding: 20px;
}

/* Categories Section */
.categories {
    width: 165px; 
    padding: 15px;
    background: transparent; 
}

.categories h3 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.category {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white; 
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.category:hover {
    transform: translateY(-5px);
}

.selected {
    border: 2px solid #8a4dff;
    box-shadow: 0 0 12px rgba(138, 77, 255, 0.4);
}

.category img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.category span {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-top: 8px;
}

.count {
    background: #e0dbff;
    color: #8a4dff;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 8px;
    border-radius: 50%;
    margin-top: 8px;
}

/* Product Grid Section */
.product-grid {
    flex-grow: 1; 
    padding: 20px;
    background: transparent; 
}

.product-grid h2 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    box-sizing: border-box;
}

.product {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
    text-align: center;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    margin: 1em 0;
}

.product:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.product .category {
    font-size: 14px;
    font-weight: 500;
    color: #555;
    margin: 5px 0;
}

.product .rating {
    color: #ffcc00;
    font-size: 14px;
    margin: 5px 0;
}

.product .price {
    background: #eee;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    margin: 10px 0;
}

/* Product View Page */
.accordion {
    display: flex;
    gap: 1em;
}

.accordion a {
    cursor: pointer;
}

.accordion, .similar-product-view p:first-child {
    font-weight: bold;
    color: gray;
}

.product-view {
    flex-direction: column;
}

.product-main-view{
    display: flex;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
    flex-wrap: wrap;
}

.product-images {
    max-width: 40em;
    padding: 1.5em;
    width: 100%;
}

.product-images img {
    border-radius: 1em;
    cursor: pointer;
}

.product-images ul li:hover{
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-images ul {
    margin: 1em 0;
    display: flex;
    gap: 0.5em;
}

.product-images ul li {
    flex: 1;
}

.product-body{
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1em;
    width: 60%;
    padding: 1.5em;
    margin-right: 4em;
}

.product-form {
    height: 100%;
    align-content: end;
    margin-bottom: 2em;
    form{
        display: inline-block;
        padding-left: 1em;
        margin-top: 1em;
    }

    input{
        height: 4em;
        box-sizing: border-box;
        padding: 1em;
        border-radius: 1em;
    };

    .add-to-cart {
        margin-left: 1em;
        border-radius: 1em;
        background-color: #8d6ee8;
        color: white;
        cursor: pointer;
        transition: 0.3 ease;
    }

    input[type="submit"]{
        font-weight: bold;
        background: none;
        border: none;
        color: white;
        cursor: pointer;
    }
    .add-to-cart:hover{
        background-color: #7a3de3;

    }
}

#total-amount {
    text-align: center;
    font-weight: bold;
    color: #A385F0;
}

#notification {
    position:fixed;
    width: 15%;
    top: 5em;
    right: 1em;
    z-index: 10;
}

#notification li {
    text-align: center;
    padding: 1em;
    border-radius: 5em;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.text-green {
    color: green;
}


.product-body .rating {
    font-size: 0.7rem;
}

.product-body .price {
    width: 10%;
    background: #eee;
    padding: 10px;
    border-radius: 10px;
    font-weight: bold;
    margin: 10px 0;
    text-align: center;
}

.product-body .description {
    line-height: 1.5;
    text-align: justify;
    font-size: 1.2rem;
}


/* Cart Section */
.cart-section {
    display: none;
    position: absolute;
    height: 68em;
    left: 4.5em;
    background-color: #F4F7FE;
    width: 96%;
}

.cart-list {
    margin-top: 1em;
    display: flex;
    gap: 2em;
}

.cart-list ul, .cart-list section {
    flex: 1;
}

.cart-list ul {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.cart-list ul li img {
    max-width: 15%;
    border-radius: 0.5em;
}

.cart-list ul li {
    display: flex;
    align-items: center;
    gap: 1em;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); 
}

.cart-list ul li p {
    margin-top: 0.2em;
    border-radius: 2em;
    padding: 0.5em 1em;
    background-color: #a385f0;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    text-align: center;
}


.cart-list ul li label{
    display: block;
    font-size: small;
}

.cart-list ul li input {
    height: 2em;
    max-width: 6em;
    text-align: center;
}

.product-quantity-form {
    margin-left: auto;
}

.cart-close-button {
    margin-left: 2em;
    margin-right: 1em;
    border-radius: 50%;
    border: none;
    font-size: x-large;
    color: gray;
    transform: 0.3s ease;
    cursor: pointer;
}

.cart-close-button:hover {
    color: red;
}

.cart-list section {
    max-width: 70%;
}


.shipping-information section {
    gap: 2em;
    margin-bottom: 0.5em;
}

.shipping-information input, .checkout-item input {
    height: 4em;
    box-sizing: border-box;
    padding-left: 1em;
    font-size: 1rem;
}

.checkout-cart h4 {
    margin-bottom: 1em;
}

.row {
    display: flex;
}

.order-summary-title {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 2px solid gray;
    max-width: 70%;
}

.order-summary {
    display: flex;
    max-width: 70%;
    justify-content: space-between;
    margin: 1em 0;
}

.order-summary span {
    font-size: 1.2rem;
    color: #A385F0;
}

.order-summary .total-amount {
    padding-top: 0.2em;
    border-top: 2px solid gray;
    font-weight: bold;
}

.checkout-item input {
    color: white;
    font-weight: bold;
    background-color: #8d6ee8;
    cursor: pointer;
    transition: .3s ease;
}

.checkout-item input:hover {
    background-color: #7a3de3;
}

.control-form{
    flex: 1;
    width: 100%;
    border-radius: 1em;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column; 
        margin-left: 0;
        padding: 10px;
    }

    .categories {
        width: 100%; 
        margin-bottom: 20px; 
    }

    .product-grid {
        width: 100%; 
    }

    .products {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    }

    .product-main-view{
        flex-direction: column;
    }

    .product-images {
        max-width: 100%;
    }


    .product-body{
        gap: 0.5em;
        width: 100%;
    }

    .product-body .description {
        font-size: 1rem;
    }

    .cart-list{
        flex-direction: column;
    }
}

@media (max-width: 480px){
    .header-text{
        display: none;
    }

    aside {
        display: none;
    }
    .main-container {
        flex-direction: column; 
        margin-left: 0;
        padding: 10px;
    }

    .search-cart-container{
        width: 100%;
        margin-left: 0;
    }

    .categories {
        width: 100%; 
        margin-bottom: 20px; 
    }

    .product-grid {
        width: 100%; 
    }

    .product-main-view{
        flex-direction: column;
    }

    .product-images {
        width: 100%;
    }

    .product-body{
        gap: 0.2em;
        width: 100%;
    }

    .product-body .description {
        font-size: 1rem;
    }
}