/* Container & Background */
.address-page {
  background-color: #f4f7f8;
  min-height: 100vh;
  padding: 40px 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

.profile-layout {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

/* Sidebar Styling */


.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    margin-bottom: 5px;
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
}

.nav-item.active {
    background-color: #f1f5f9; /* Light grey active background */
    color: #1e293b;
    font-weight: 600;
}

/* Page Header & Green Button */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.btn-add-address {
    background-color: #4ade80; /* The bright green */
    text-decoration: none;
    font-size: 12px;
    color: #064e3b;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(74, 222, 128, 0.4);
}

/* Address Card - Matches the pic perfectly */
.address-card {
    background: #ffffff;
    border: 1px solid #eff2f4;
    border-radius: 18px;
    padding: 15px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(173, 255, 8, 0.02);
}

.badge-home {
    background: #1e293b;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 5px 15px;
    border-radius: 20px;
}

.badge-label{
    font-size: 10px;
    border-radius: 12px;
    color: #ffffff;
    background-color: #000000;
    padding: 2px 5px;
}

.default-badge{
      font-size: 10px;
    border-radius: 5px;
    color: #776f6f;
    background-color: #c3c3c342;
    padding: 2px 5px;
}

.card-content h3 {
    margin: 20px 0 10px 0;
    font-size: 14px;
    color: #000000;
}

.card-content p, .icon-small  {
    color: #515356;
    line-height: 1.5;
    margin: 0;
    font-size: 12px;
}

.card-footer {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #000000;
    font-weight: 400;
}

/* Breadcrumb */
.breadcrumb-nav {
    font-size: 8px;
    color: #94a3b8;
    text-decoration: none;
}

.breadcrumb a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.breadcrumb a:hover {
    color: #000;
    text-decoration: underline;
}

.page-header h1{
    font-size: 21px;
    font-weight: 600;
}

.form-error{
    margin-bottom: 20px;
    
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
}

.field-error{
    display: block;
    margin-top: 4px;
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
}

.actions-card img{
    width: 12px;
    height: 12px;
}

.modal-content {
    background: #fff;
    width: 380px; /* Slimmer width for better look */
    border-radius: 12px;
    padding: 10px 20px; /* Reduced vertical padding from 24px */
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

/* Three Column Layout for City/State/Pincode */
.form-row.three-col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.form-group input {
    width: 100%;
    padding: 4px 10px; /* Thinner internal padding */
    height: 28px;      /* Forced short height to pull bottom up */
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 11px;   /* Smaller text to match compact box */
    outline: none;
}

.form-group input:focus {
    border-color: #4ade80;
}

/* Address Type Chips (The pill buttons) */
.type-selection {
    display: flex;
    gap: 12px;
    margin-top: 5px;
}

.type-chip {
    cursor: pointer;
}

.type-chip input {
    display: none; /* Hide the actual radio dot */
}

.type-chip span {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 30px;
    font-size: 11px;
    color: #4b5563;
    transition: 0.3s;
}

/* When the radio is checked, change the pill color */
.type-chip input:checked + span {
    background-color: #f3f4f6;
    border-color: #1f2937;
    color: #111827;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 4px; /* Shrunk from 24px */
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
}

.btn-address-save {
    background-color: #ecba06 !important;
    color: white;
    padding: 6px 10px; /* Smaller button height */
    border: none;
    border-radius: 6px;
    font-weight: 400;
    font-size: 11px;
    cursor: pointer;
}

/* --- THE FIX: ADD THIS --- */

/* 1. Initial State: Hidden */
.modal-overlay {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Dimmed background */
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px); /* Matches the blur in your pic */
}

/* 2. Show state: Triggered by your JS */
.modal-overlay.active {
    display: flex !important;
}

/* 3. Close button 'X' styling */
.close-x {
    cursor: pointer;
    font-size: 24px;
    color: #94a3b8;
}

.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 2px !important; /* Removes massive gap between rows */
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0px !important; /* Kills space between label and input box */
    margin-bottom: 4px !important;
}

.form-group label {
    font-size: 9px; /* Smaller, cleaner labels */
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 1px !important; /* Pulls input box closer to label */
    text-transform: uppercase;
}
/* --- END OF FIX --- */

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

}

.modal-header h3{
    font-size: 12px;
    margin: 0;
}

.premium-tag {
    font-size: 10px;
    font-weight: bold;
    color: #d4af37;
}


/* Ensure the header can push items to opposite sides */
.card-header {
    display: flex;
    justify-content: space-between; /* Badge on left, Icons on right */
    align-items: center;
    width: 100%;
    height: 30px;
}

/* Container for the small icons */
.action-icons {
    display: flex;
    gap: 12px; /* Space between edit and delete icons */
    align-items: center;
}

/* Target the icons specifically */
.action-icons img, 
.icon-small {
    width: 16px;  /* Smaller size */
    height: 16px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.action-icons img:hover {
    transform: scale(1.1); /* Subtle grow effect on hover */
    opacity: 0.8;
}

.profile-icon{
   width: 35px;
   height: 35px;
}

.address-card{
    margin-bottom: 12px;
}

.profile-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;

    height: auto;        /* ✅ FIX */
    min-height: auto;    /* ✅ SAFE */
}

.address-container{
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.icon-tiny{
    height: 12px;
    width: 12px;

}

.btn-cancel{
    font-size: 5px;
    padding: 2px;
    border-radius: 5px;
    border-style: none;
}

/* Add Address Form */
.address-form-wrapper{
    width: 100%;
    max-width: 750px;
    background: #fff;
    padding: 35px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.address-form-wrapper form{
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-row{
    display: flex;
    gap: 18px;
}

.form-row.three-col{
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 18px;
}

.form-group{
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label{
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: none;
}

.form-group input{
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    transition: .2s;
}

.form-group input:focus{
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17,24,39,.08);
}

.type-selection{
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.type-chip input{
    display: none;
}

.type-chip span{
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 30px;
    font-size: 8px;
    cursor: pointer;
    transition: .2s;
}

.type-chip input:checked + span{
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.default-check{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
}

.form-actions{
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.btn-cancel{
    padding: 12px 20px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.btn-save:hover{
    opacity: .9;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* ==========================================
   1. Tablet & Smaller Laptops (Max Width: 1024px)
   ========================================== */
@media screen and (max-width: 1024px) {
  .profile-layout {
    gap: 20px;
    margin-top: 15px;
  }

  .profile-sidebar {
    width: 200px;
    padding: 20px 15px;
  }

  .address-form-wrapper {
    padding: 15px;
  }
}


/* ==========================================
   2. Mobile & Portrait Tablets (Max Width: 768px)
   ========================================== */
@media screen and (max-width: 768px) {

    .profile-layout {
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
  }

  /* Sidebar takes full width and transforms into a horizontal or block menu */
   .btn-add-address{
    font-size: 10px;
    padding: 5px 5px;
   }

   .header-titles h1{
    font-size: 12px;
   }

   .header-titles p{
    font-size: 10px;
   }

   .breadcrumb a{
    font-size: 8px;
   }

   .page-header h1{
    font-size: 12px;
   }
  /* Main content / form wrapper takes full width */
  .address-form-wrapper {
    width: 100%;
    padding: 14px 12px;
  }

  .type-chip span{
    font-size: 8px;
    padding: 4px 10px;
  }

  .default-check{
    font-size: 10px;
  }

}

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

    .profile-layout {
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
  }

  /* Sidebar takes full width and transforms into a horizontal or block menu */
   .btn-add-address{
    font-size: 8px;
    padding: 5px;
   }

   .header-titles h1{
    font-size: 16px;
   }

   .header-titles p{
    font-size: 13px;
   }
  .address-form-wrapper {
    width: 100%;
    padding: 10px 15px;
  }
}

