body    {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    background: #f4f4f4;
}

header  {
    background: #222;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
}

nav {
    background: #444;
    padding: 10px;
}

nav button  {
    margin-right: 10px;
    padding: 8px;
    border: none;
    cursor: pointer;
}

.card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    width: 220px;
    margin: 10px;
    display: inline-block;
    vertical-align: top;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.product-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
}

.price {
    font-size: 20px;
    font-weight: bold;
    color: green;
}

.location {
    font-size: 14px;
    color: gray;
}

.card button {
    background: black;
    color: white;
    border: none;
    padding: 8px;
    width: 100%;
    border-radius: 5px;
    cursor: pointer;
}

.navbar{
    display:flex;
    align-items:center;
    gap:15px;
    padding:12px 20px;
    background:#2d2d2d;
}

.logo{
    color:white;
    font-size:22px;
    font-weight:bold;
}

.navbar select{
    padding:8px;
}

#searchInput{
    flex:1;
    padding:10px;
    border-radius:5px;
    border:none;
}

#authArea{
    margin-left:auto;
}

#authArea button{
    margin-left:10px;
    padding:8px 12px;
}

/* Container layout to center the cards */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9fafb;
}

/* Glassmorphism/Clean Card design */
.auth-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
}

/* Typography styles */
.auth-card h2 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

.auth-card .subtitle {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}

/* Input and Select fields */
.auth-card .input-field,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card .modern-select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background-color: #fff;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* Input Focus effects */
.auth-card input:focus,
.auth-card .modern-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.auth-card .btn-primary {
    width: 100%;
    padding: 14px;
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.auth-card .btn-primary:hover {
    background-color: #4338ca;
}

/* Auth state switcher text */
.auth-card .switch {
    margin-top: 24px;
    margin-bottom: 0;
    text-align: center;
    font-size: 14px;
    color: #4b5563;
}

.auth-card .switch a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.auth-card .switch a:hover {
    text-decoration: underline;
}

.message{
    margin:8px;
    padding:8px 12px;
    border-radius:10px;
    max-width:70%;
    font-size:14px;
}

.sent{
    background:#DCF8C6;
    margin-left:auto;
    text-align:right;
}

.received{
    background:#eee;
    margin-right:auto;
}

.time{
    font-size:10px;
    color:gray;
}

.badge {
    background: red;
    color: white;
    border-radius: 50%;
    padding: 5px 8px;
    font-size: 12px;
    margin-left: 10px;
}

/* Container */
.product-container {
    max-width: 1100px;
    margin: auto;
    padding: 20px;
    font-family: Arial, sans-serif;
}

/* Images */
.product-images img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 10px;
}

/* Details */
.product-details {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Price */
.price {
    color: green;
    font-size: 24px;
    font-weight: bold;
}

/* Buttons */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 10px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-success {
    background: green;
    color: white;
}

/* Section titles */
.section-title {
    margin-top: 20px;
    font-weight: bold;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

/* Responsive (mobile) */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* LEFT */
.left-side {
    flex: 1;
    min-width: 350px;
}

/* TOP INFO */
.product-top {
    margin-bottom: 10px;
}

.price {
    font-size: 20px;
    font-weight: bold;
    color: green;
}

/* IMAGE */
.image-slider {
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.slide {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: none;
    border-radius: 8px;
}

.slide.active {
    display: block;
}

.slider {
    width: 50%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 10px;
}

/* RIGHT */
.right-side {
    flex: 1;
    min-width: 300px;
    background: #f8f8f8;
    padding: 15px;
    border-radius: 8px;
}

/* SELLER */
.seller-link {
    color: blue;
    cursor: pointer;
    font-weight: bold;
}

/* comments */
.comments-section {
    margin-top: 20px;
}

.comment-form {
    margin-bottom: 10px;
}

/* 🔥 SCROLL AREA */
.comments-box {
    max-height: 300px;   /* control height */
    overflow-y: auto;    /* enable up/down scroll */
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
    background: #fafafa;
}

/* optional: nicer scrollbar */
.comments-box::-webkit-scrollbar {
    width: 6px;
}

.comments-box::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 5px;
}

.comment {
    background: #f1f3f5;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.comment strong {
    color: #007bff;
}

.comment small {
    color: gray;
}

.info-right {
    border-left: 3px solid #007bff;
}

@media (max-width: 768px) {
    .product-info-grid {
        grid-template-columns: 1fr;
    }
}

.top-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 🔥 FORCE 3 COLUMNS */
    gap: 20px;
    align-items: start;
}

/* columns */
.col {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    min-width: 0; /* 🔥 prevents overflow breaking layout */
}

/* details */
.details-col {
    border-left: 4px solid #007bff;
}

/* description column */
.desc-col {
    max-height: 400px;
    overflow: hidden;
}

/* comments scroll */
.comments-box {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 6px;
}

/* price */
.price {
    font-size: 20px;
    font-weight: bold;
    color: green;
}

#content {
    width: 100%;
}

.product-page {
    max-width: 1100px;
    margin: auto;
    padding: 20px;
}

/* TOP GRID */
.top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* REDUCE HEIGHT */
/* REDUCE HEIGHT - FIX: Changed fixed height to auto-expanding min-height */
/* UPDATED DETAILS BOX LAYOUT */
/* Container Box Layout rules */
/* 🔑 ULTIMATE CONTAINMENT OVERRIDE */
.details-box {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 4px 24px !important;
    align-content: start !important;
    
    /* Force absolute height fluidity */
    height: auto !important; 
    max-height: none !important;
    min-height: 180px !important;
    overflow: visible !important; 
    padding-bottom: 20px !important; /* Breathing room for the chat block */
}

/* Ensure the parent columns don't cap heights either */
.top-row, 
.product-main, 
.col, 
.top-3col {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Fix button layout structure inside the grid track */
.details-chat-actions {
    grid-column: 1 / -1 !important;
    display: flex !important;
    gap: 12px !important;
    margin-top: 14px !important;
    height: auto !important;
}


/* 🔑 THE HEADING GRID SPAN ISOLATOR */
.details-box .details-heading {
    grid-column: 1 / -1;              /* Force text tag to span across both grid columns */
    margin: 0 0 10px 0 !important;    /* Clear browser spacing and append 10px bottom gap */
    font-size: 20px;
    font-weight: bold;
    color: #1f2937;
}

/* Clear margins inside child elements to let grid-gap work */
.details-box .detail-item {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4;
    font-size: 15px;
}


/* 🔑 THE CRITICAL FIX: Strip out browser margins from elements inside the details box */
.details-box p, 
.details-box div, 
.details-box h3,
.details-box h4 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4; /* Gives a tight, highly readable text layout */
}


/* Ensure the Summary box remains normal since it doesn't hold data grids */
.summary-box {
    background: #fff;
    padding: 5px;
    border-radius: 10px;
    min-height: 180px;
    height: auto;
    overflow: visible;
}


/* IMAGE SLIDER */
.image-slider {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

.image-slider img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

/* NAV BUTTONS */
.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.prev { left: 10px; }
.next { right: 10px; }

/* BOTTOM SECTION */
.bottom-section {
    margin-top: 20px;
}

/* COMMENTS SCROLL */
.comments-box {
    max-height: 250px;
    overflow-y: auto;
    border-top: 1px solid #ddd;
    margin-top: 10px;
    padding-top: 10px;
}

/* PRICE */
.price {
    color: green;
    font-weight: bold;
    font-size: 20px;
}

/* PRODUCT LAYOUT */
.product-wrapper{
    display:flex;
    gap:20px;
    align-items:flex-start;
    width:100%;
    max-width:1200px;
    margin:auto;
    padding:15px;
    box-sizing:border-box;
}

.product-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    align-items: flex-start;
}

/* LEFT SIDE */
.product-main{
    flex:2;
    min-width:0;
    width:50%;
}

/* RIGHT SIDE */
.side-column{
    width:50%;
    flex:1;
    background:#fff;
    padding:15px;
    border-radius:10px;
    box-sizing:border-box;
}

.modern-select {
    width: 100%;
    max-width: 400px;

    padding: 12px 14px;

    border: 1px solid #ddd;
    border-radius: 10px;

    background: white;

    font-size: 15px;

    outline: none;

    transition: 0.3s ease;

    cursor: pointer;

    box-sizing: border-box;
}

.modern-select:focus {
    border-color: #007bff;

    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

/* TOP INFO */
.top-row{
    display:flex;
    gap:20px;
    margin-bottom:20px;
}

.details-box,
.info-box{
    flex:1;
    background:#fff;
    padding:15px;
    border-radius:10px;
    box-sizing:border-box;
}

/* SLIDER */
.slider-wrapper{
    position:relative;
    width:100%;
}

.slider{
    position: relative;
    width:100%;
    height:500px;
    overflow:hidden;
    border-radius:10px;
    background:#000;
}

.slide{
    position: absolute;
    width:100%;
    height:100%;
    object-fit:cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active{
    opacity: 1;
}

/* NAV BUTTONS */
.prev,
.next{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    background:rgba(0,0,0,0.5);
    color:#fff;
    border:none;
    padding:10px;
    cursor:pointer;
    font-size:20px;
    z-index:5;
}

.prev{
    left:10px;
}

.next{
    right:10px;
}

/* COMMENTS */
.comments-box{
    max-height:500px;
    overflow-y:auto;
    border-top:1px solid #ddd;
    margin-top:10px;
    padding-top:10px;
}

.thumbnails{
    display:flex;
    gap:8px;
    margin-top:10px;
}

.thumbnails img{
    width:60px;
    height:50px;
    object-fit:cover;
    cursor:pointer;
    border-radius:5px;
    opacity:0.7;
}

.thumbnails img:hover{
    opacity:1;
    border:2px solid #007bff;
}

.badge-admin {
    background: red;
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
}

.badge-pending {
    background: orange;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    display: inline-block;
    margin-top: 5px;
}

/* Container framework layouts */
.upload-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    padding: 30px 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9fafb;
}

.upload-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 650px;
    box-sizing: border-box;
}

.upload-card h2 {
    margin: 0 0 6px 0;
    color: #1f2937;
    font-size: 26px;
    font-weight: 700;
}

.upload-card .subtitle {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 14px;
}

/* Row wrapper for side-by-side elements */
.upload-card .form-row {
    display: flex;
    gap: 16px;
}

.upload-card .form-row .input-field,
.upload-card .form-row .modern-select {
    flex: 1;
}

/* Shared form inputs */
.upload-card .input-field,
.upload-card .modern-select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background-color: #fff;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.upload-card .textarea-field {
    resize: none;
    font-family: inherit;
}

/* Focusing rules */
.upload-card input:focus,
.upload-card .modern-select:focus,
.upload-card textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Dynamic field container alignment layout */
.dynamic-container {
    background-color: #f8fafc;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

/* Embedded layout for inner dynamic nodes if injected as pairs */
.dynamic-container .form-row {
    padding: 12px 12px 0 12px;
}

/* Styled File Uploader Component UI */
.image-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background-color: #f6f8fa;
    margin-bottom: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-upload-zone:hover {
    border-color: #4f46e5;
    background-color: #f5f3ff;
}

.image-upload-zone .upload-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.image-upload-zone .upload-text {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin: 0;
}

.image-upload-zone .upload-subtext {
    font-size: 12px;
    color: #9ca3af;
    margin: 4px 0 0 0;
}

/* Command Trigger Submission Button */
.upload-card .btn-primary {
    width: 100%;
    padding: 14px;
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.upload-card .btn-primary:hover {
    background-color: #4338ca;
}


/* Individual Action Button Foundations */
.chat-btn {
    flex: 1;
    padding: 8px 12px;         /* 🔑 Reduced from 12px to 8px for a thinner look */
    border-radius: 6px;        /* Slightly sharper edges to match smaller scale */
    font-size: 13px;           /* 🔑 Smaller text size (down from 14px) */
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: background 0.2s ease;
    box-sizing: border-box;
    height: 12px;              /* 🔑 Explicitly caps the height so they stay clean and compact */
}


/* WhatsApp Brand Coloring Scheme */
.btn-whatsapp {
    background-color: #25D366;
    color: white !important;
}

.btn-whatsapp:hover {
    background-color: #20ba5a;
}

/* Direct Chat App Accent Coloring Scheme */
.btn-direct {
    background-color: #007bff;
    color: white;
}

.btn-direct:hover {
    background-color: #0056b3;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

.user-row .col {
    flex: 1;
    padding: 0 8px;
}

.user-row .actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.new {
    background: orange;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.ack {
    background: green;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* Responsive adjustment layer for mobile setups */
@media (max-width: 480px) {
    .details-chat-actions {
        flex-direction: column; /* Stack buttons vertically on small screens */
        gap: 8px;
    }
}

/*Chat*/
.chat-modal{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,0.5);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
    bottom: 20px;
    right:20px;
}

.chat-container{
    width:400px;
    height:600px;
    background:white;
    border-radius:10px;
    display:flex;
    flex-direction:column;
    overflow:hidden;
}

.chat-header{
    padding:10px;
    background:#111827;
    color:white;
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.chat-box{
    flex:1;
    overflow-y:auto;
    padding:10px;
    background:#f3f4f6;
}

.message{
    margin-bottom:10px;
    padding:10px;
    border-radius:10px;
    max-width:80%;
}

.sent{
    background:#2563eb;
    color:white;
    margin-left:auto;
}

.received{
    background:#e5e7eb;
    color:black;
    margin-right:auto;
}

.chat-input-area{
    display:flex;
    padding:10px;
    gap:10px;
}

.chat-input-area input{
    flex:1;
    padding:10px;
}


/* MOBILE RESPONSIVE */
@media screen and (max-width: 768px) {

    .product-layout {
        flex-direction: column;
    }

    .top-row {
        flex-direction: column;
        gap: 20px;
    }

    .product-main {
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
    }

    .details-box,
    .info-box,
    .side-column {
        width: 100%;
        grid-template-columns: 1fr; /* Stacks them up cleanly on phones */
    }


    .slider-wrapper {
        width: 100%;
        overflow: hidden;
    }

    .slider {
        height: 300px;
    }

    .slider img,
    .slide {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    .card {
        width: 100%;
        box-sizing: border-box;
    }

    img {
        max-width: 100%;
    }

    /* HEADER FIX */
    header,
    .header,
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #searchInput,
    .navbar select{
        width:100%;
    }



    #authArea {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    #authArea button {
        flex: 1;
        min-width: 120px;
    }

     /* PRODUCT */
    .product-wrapper{
        flex-direction:column;
        padding:10px;
    }

    /* FILTERS */
    select,
    input,
    textarea,
    button {
        width: 100%;
        box-sizing: border-box;
    }

    /* TITLE */
    h1 {
        font-size: 32px;
        line-height: 1.1;
    }
}



