.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    animation-name: animateopac;
    animation-duration: 0.4s;
    overflow: hidden;
}
.modal-header {
    padding: 2px 16px;
    background-color: #c5ea99;
    border-radius: 12px 12px 0 0;
}

.modal-header > .close {
	position: absolute;
	font-size: 4.0rem;
  font-weight: bold;
	color: #d05d5d;
  right: 20px;
	top: -2px;
  cursor: pointer;
}

.modal-header > h2 {
	font-size: 2.4rem;
	text-align: center;
	padding: 10px;
}

.modal.error .modal-header,
.modal.success .modal-footer {
    background-color: #ce690a;
    color: #fff;
}
.modal.success .modal-header,
.modal.success .modal-footer {
    background-color: #5cb85c;
    color: #fff;
}
.modal-title {
    font-size: 2.4rem;
    font-weight: normal;
    color: #444;
    margin: 8px 4px 4px;
}
.modal-subtitle {
    font-size: 1.6rem;
    font-weight: bold;
    margin-top: 0;
}
.modal-body {
    padding: 16px;
    font-size: 1.6rem;
    height: calc(100vh - 150px);
    overflow: auto;
}
.modal-footer {
    display: none;
    padding: 6px 16px;
    background-color: #f0f0f0;
    color: white;
    border-radius: 0 0 6px 6px;
    overflow: auto;
}
.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 12px;
    width: 95%;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    animation-duration: 0.4s;
    animation-name: animatetop;
    max-width: 800px;
    bottom: -85px;
}

.modal ul {
  padding-left: 20px;
}

#quick-add .modal-content {
  top: auto;
  animation-name: animatebottom;
}

#show-cart .modal-content {
  animation-name: animateright;
}

.modal .iti {
  display: revert;
}


#login-container,
#register-container
 {
    background: white;
    border-radius: 10px;
    box-shadow: 5px 5px 20px rgba(149, 191, 0, 0.57);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    margin: auto;
}

.modal .form-title {
  text-align: center;
  color: #333;
  font-size: 2.4rem;
  margin-bottom: 30px;
  font-weight: 600;
}

#register-container .form-title {
  font-size: 2.0rem;
  margin-bottom: 0px;
}

.modal .form-subtitle {
  text-align: center;
  color: #666;
  font-size: 1.8rem;
  margin-bottom: 10px;
  font-style: italic;
}

.modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

.modal .form-group {
    margin-bottom: 10px;
}

.modal .form-group label {
    display: block;
    color: #333;
    font-size: 1.4rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.modal .form-group label .required {
  color: #c33;
}

.modal .form-group input,
.modal .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1.6rem;
    transition: all 0.3s ease;
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal .form-group input.error {
    border-color: #c33;
}

.modal .form-group .error-message {
    color: #c33;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.modal .form-group .error-message.show {
    display: block;
}

.modal .form-group .hint {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.modal .form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.modal .remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal .remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.modal .remember-me label {
    color: #666;
    cursor: pointer;
}

.modal .forgot-password {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.modal .forgot-password:hover {
    text-decoration: underline;
}

.modal .btn-login,
.modal .btn-register {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #aef27e 0%, #b8f978 100%);
    color: #333;
    border: 1px solid #9acc77;
    border-radius: 6px;
    font-size: 1.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal .btn-login:hover,
.modal .btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.modal .btn-login:active,
.modal .btn-register:active {
    transform: translateY(0);
}

.modal .btn-login:disabled,
.modal .btn-register:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}


.modal .divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.modal .divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.modal .divider span {
    background: white;
    padding: 0 15px;
    color: #999;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.modal .login-link #btn-login,
.modal #next_btn,
.modal #back_btn,
.modal #accept_terms,
.modal #request_otp {
  padding: 6px 20px;
  margin-left: 8px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #aef27e 0%, #b8f978 100%);
  color: #333;
  border: 1px solid #9acc77;
  border-radius: 6px;
  font-size: 1.8rem;
  font-weight: 600;
  cursor: pointer;
}

.modal #next_btn {
  width: 100%;
}

.modal #next_btn, .modal #back_btn, .modal #accept_terms {
	margin: 0;
	padding: 12px;
	background: linear-gradient(135deg, #117fc8 0%, #14538c 100%);
	font-size: 1.4rem;
	color: #fff;
	border: 1px solid #76c8ff;
}

.modal .signup-link,
.modal .login-link {
  text-align: center;
  margin: 20px 0;
  color: #0051d0;
  font-size: 1.6rem;
}

.modal #request_otp {
  display: block;
  margin-left: auto;
}

.modal button:disabled {
  opacity: 0.6;
}

.modal .signup-link a,
.modal .login-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.modal .signup-link a:hover,
.modal .login-link a:hover {
    text-decoration: underline;
}

.modal #validate_mobile {
  padding: 0 10px;
}

.modal .error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #c33;
    display: none;
}

.modal .error-message.show {
    display: block;
}

.error-alert {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #c33;
    display: none;
}

.error-alert.show {
    display: block;
}

.success-alert {
    background: #efe;
    color: #2a7;
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #2a7;
    display: none;
}

.success-alert.show {
    display: block;
}


#profile-container, #cart-container {
    max-width: 95%;
    margin: 0 auto;
    padding: 20px 4px;
}

#profile-container .header {
    background: #e0ffba;
    border-radius: 10px;
    /* box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); */
    padding: 30px 40px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D2691E 0%, #A0522D 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 auto;
}

.user-info h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 5px;
}

.user-info p {
    font-size: 1.6rem;
    padding: 2px 0;
}

#edit-profile {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 8px 24px;
	background-color: #fba02c;
	border: 0;
	border-radius: 18px;
	font-size: 1.6rem;
	color: #fff;
	font-weight: bold;
	box-shadow: 1px 1px 4px #888;
    cursor: pointer;
    transition: all 0.3s ease;
}

#logout {
	background-color: rgb(221, 69, 69);
	border-radius: 24px;
	font-size: 1.8rem;
	padding: 12px 50px;
	margin: 10px 0;
	box-shadow: 1px 2px 4px #888;
	border: 0;
	cursor: pointer;
	color: #fff;
    transition: all 0.3s ease;
}

#edit-profile:hover,
#logout:hover {
    transform: translateY(-2px);
}

#profile-container .content {
    display: block;
}

#profile-container .main-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

#profile-container .section-title {
    color: #333;
    font-size: 24px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #FFE8CC;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE8CC 100%);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
}

.stat-card .number {
    font-size: 36px;
    font-weight: 700;
    color: #D2691E;
    margin-bottom: 5px;
}

.stat-card .label {
    color: #666;
    font-size: 14px;
}

.recent-orders {
    margin-top: 40px;
}

.order-card {
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.order-card:hover {
    border-color: #FFE8CC;
    box-shadow: 0 3px 10px rgba(210, 105, 30, 0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.order-id {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.order-status {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.order-details {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

.order-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total {
    font-weight: 700;
    color: #D2691E;
    font-size: 18px;
}

.view-order-btn {
    color: #D2691E;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.view-order-btn:hover {
    text-decoration: underline;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}




.cart-items {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    padding: 20px;
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.item-card {
    box-shadow: 0 2px 10px #0003;
    border-radius: 6px;
    padding: 4px 12px;
}

.cart-item:hover {
    border-color: #FFE8CC;
    box-shadow: 0 3px 10px rgba(210, 105, 30, 0.1);
}

.cart-item a {
    display: flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
}

.item-image {
    border-radius: 8px;
    object-fit: cover;
    background: #f8f8f8;
}

.item-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.item-name {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.item-name a {
    color: #333;
    text-decoration: none;
}

.item-name a:hover {
    color: #D2691E;
}

.item-warn {
	font-size: 1.4rem;
	color: orangered;
    text-align: center;
}

.item-info {
    color: #666;
    font-size: 1.4rem;
    text-align: center;
}

.item-price {
    display: flex;
    align-items: start;
    font-size: 1.6rem;
    font-weight: 700;
    color: #D2691E;
}

.item-price .original-price {
    font-size: 1.4rem;
    text-align: left;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.item-actions {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    padding: 4px;
    margin-bottom: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f8f8f8;
    color: #333;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #D2691E;
    color: white;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.quantity-input {
    -moz-appearance: textfield;
    width: 50px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.remove-btn {
    color: #c33;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 16px;
    border: 2px solid #c33;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #c33;
    color: white;
}

.item-subtotal {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    text-align: right;
}

.cart-summary {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.summary-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #FFE8CC;
}

.cart-summary table {
    margin-left: auto;
    text-align: left;
}

.summary-row {
    padding: 12px 0;
    font-size: 1.8rem;
}

.summary-row > * {
    padding: 4px 12px;
}

.summary-row td {
    text-align: right;
}

.summary-row.total {
    border-top: 2px solid #FFE8CC;
    margin-top: 10px;
    padding-top: 20px;
    font-size: 2.4rem;
    font-weight: 700;
    color: #333;
    width: fit-content;
    margin-left: auto;
}

.summary-row.total .amount {
    color: #D2691E;
    padding: 4px 14px;
}

.discount-code {
    margin: 20px 0;
}

.discount-code input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 10px;
}

.apply-btn {
    width: 100%;
    padding: 10px;
    background: white;
    color: #D2691E;
    border: 2px solid #D2691E;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-btn:hover {
    background: #FFF5E6;
}

.checkout-btn {
    display: block;
    padding: 12px 20px;
    background: linear-gradient(135deg, #D2691E 0%, #A0522D 100%);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 1.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    margin-left: auto;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(210, 105, 30, 0.4);
}

.secure-checkout {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-top: 15px;
}

.secure-icon {
    color: #00C851;
    margin-right: 5px;
}

.empty-cart {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 80px 40px;
    text-align: center;
}

.empty-cart-icon {
    font-size: 100px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-cart h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 15px;
}

.empty-cart p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

.savings-badge {
    background: #00C851;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 1.4rem;
    font-weight: 600;
    margin-left: 6px;
    margin-top: 5px;
}

.stock-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

.in-stock {
    background: #d4edda;
    color: #155724;
}

.low-stock {
    background: #fff3cd;
    color: #856404;
}


@keyframes animatetop {
    from {top: -300px}
    to {top: 80px}
}
@keyframes animatebottom {
    from {bottom: -500px}
    to {bottom: -85px}
}
@keyframes animateright {
    from {right: -600px}
    to {right: 0px}
}
@keyframes animateopac {
    from {opacity: 0}
    to {opacity: 1}
}


@media only screen and (max-width: 1080px) {
  .modal #product-page .product-image {
    width: 90%;
  }
}

@media only screen and (max-width: 960px) {
    #profile-container .content {
        grid-template-columns: 1fr;
    }
    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media only screen and (max-width: 860px) {

}

@media only screen and (max-width: 760px) {
    #profile-container .main-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    #profile-container .navbar {
        grid-template-columns: 1fr 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .cart-items {
        padding: 6px;
    }

    .cart-item {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 4px;
        gap: 4px;
    }

    .cart-item a {
        justify-content: center;
    }

    .item-card {
        margin-bottom: 6px;
    }

    .item-actions {
        flex-direction: row-reverse;
        padding-inline: 12px;
    }

    .quantity-control {
        margin: 4px 0 12px;
    }

    .remove-btn {
        margin-bottom: 12px;
    }

}

@media only screen and (max-width: 660px) {
  
}

@media only screen and (max-width: 600px) {
  .modal-content {
    width: 98%;
  }

  .modal-body {
    padding: 4px;
  }
  
  #profile-container, #cart-container {
    max-width: 98%;
    padding-inline: 0;
  }
}

@media only screen and (max-width: 470px) {
  .modal #product-details h1 {
    font-size: 2.6rem;
    margin-bottom: 5px;
  }

  .modal .form-title {
    font-size: 20px;
  }

  #register-container {
    padding: 10px;
  }
}