@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@500;600;700;800&display=swap');

:root {
    --bg-body: #F4F6F8;
    --bg-white: #FFFFFF;
    --primary: #111827;
    --accent: #F59E0B;
    --accent-hover: #D97706;
    --text-main: #1F2937;
    --text-light: #6B7280;
    --radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* --- NUCLEAR FIX FOR HORIZONTAL SCROLL --- */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* Cuts off any side overflow */
    margin: 0; 
    padding: 0;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex; flex-direction: column; min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; color: var(--primary); font-weight: 700; }
a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- Header --- */
header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: sticky; top: 0; z-index: 1000;
    width: 100%;
}

.top-bar { 
    background: #6F4E37; /* Coffee Color */
    color: white; 
    text-align: center; 
    padding: 10px 20px; 
    font-size: 0.85rem; 
    letter-spacing: 0.5px; 
    
    /* Layout to show items side-by-side */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 25px; /* Space between Phone and Email */
    flex-wrap: wrap; /* Wraps cleanly on mobile */
}

/* Optional: Add a subtle separator icon/line styling if needed */
.top-bar span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Flex container for the whole header bar */
.nav-container { 
    max-width: 1300px; 
    margin: 0 auto; 
    padding: 10px 20px; 
    display: flex; 
    justify-content: space-between; /* Pushes Logo left, Nav right */
    align-items: center; 
    width: 100%;
}


.logo img { height: 60px; width: auto; object-fit: contain; }
.logo h1 { font-size: 1.4rem; margin: 0; color: var(--primary); line-height: 1.2; }

nav ul { display: flex; gap: 30px; list-style: none; padding: 0; margin: 0; }
nav a { font-weight: 500; font-size: 0.95rem; color: var(--text-main); white-space: nowrap; }
nav a:hover { color: var(--accent); }

/* --- Hero Section --- */
.hero { 
    position: relative;
    height: 65vh; 
    min-height: 500px;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.7)), url('cover.jpg'); 
    background-size: cover; 
    background-position: center; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    color: white; 
    width: 100%;
}
.hero-content { 
    max-width: 800px; 
    padding: 20px; 
    width: 100%; /* Ensures it doesn't overflow parent */
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.hero h1 { 
    font-size: 3.5rem; 
    margin-bottom: 20px; 
    color: #fff; 
    word-wrap: break-word; /* Prevents long words breaking layout */
}

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: white; padding: 14px 35px;
    font-weight: 600; border-radius: 50px; border: none; cursor: pointer;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-outline { background: transparent; border: 2px solid white; box-shadow: none; margin-left: 10px; }
.btn-outline:hover { background: white; color: var(--primary); }

/* --- Layout --- */
.container { 
    max-width: 1280px; 
    margin: 0 auto; 
    padding: 60px 25px; 
    width: 100%; 
    flex: 1; 
}
.section-header { margin-bottom: 50px; }

/* --- Grid & Cards --- */
.grid { 
    display: grid; 
    /* IMPORTANT: Min-width reduced to 250px to prevent overflow on small phones */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 30px; 
    width: 100%;
}

.card {
    background: var(--bg-white); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: 0.4s; border: 1px solid rgba(0,0,0,0.03);
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.card-img-wrapper { height: 260px; overflow: hidden; position: relative; background: #f9f9f9; }
.card-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.6s; }
.card:hover img { transform: scale(1.08); }

.card-body { 
    padding: 20px; 
    display: flex; flex-direction: column; flex-grow: 1; 
    justify-content: space-between; gap: 15px; 
}
.card-title { font-size: 1.1rem; margin-bottom: 5px; color: var(--text-main); }
.card-price-row { display: flex; justify-content: space-between; align-items: center; }
.card-price { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.card-unit { font-size: 0.9rem; color: var(--text-light); }
.btn-block { width: 100%; padding: 12px; border-radius: 8px; }
.badge { position: absolute; top: 15px; left: 15px; background: white; padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

/* --- Dropdown --- */
.weight-select-wrapper { position: relative; width: 100%; }
.weight-select {
    width: 100%; appearance: none; -webkit-appearance: none;
    background-color: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 10px 15px; padding-right: 35px;
    font-family: 'Inter', sans-serif; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.weight-label { display: block; font-size: 0.75rem; color: var(--text-light); font-weight: 600; text-transform: uppercase; margin-bottom: 5px; }

/* --- Contact & Footer --- */
.contact-container { display: grid; grid-template-columns: 1fr 1.5fr; background: white; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); width: 100%; }
.contact-left { background: var(--primary); color: white; padding: 50px; }
.contact-right { padding: 50px; }
input, textarea { width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid #eee; border-radius: 8px; background: #f9f9f9; }

footer { background: #fff; padding: 60px 0 30px; margin-top: auto; border-top: 1px solid #eaeaea; width: 100%; }
.footer-wrapper { max-width: 1280px; margin: 0 auto; padding: 0 25px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.footer-col h3 { font-size: 1.1rem; margin-bottom: 20px; color: var(--primary); }
.footer-col a { display: block; color: var(--text-light); margin-bottom: 10px; font-size: 0.95rem; }
.copyright { text-align: center; margin-top: 50px; padding-top: 20px; border-top: 1px solid #f0f0f0; color: #999; font-size: 0.85rem; }

/* --- MOBILE RESPONSIVENESS (320px - 768px) --- */
@media (max-width: 768px) {
    /* RESET: Ensure no element forces width */
    html, body { width: 100vw; overflow-x: hidden; }

    /* Header: Stack logo and menu */
    .nav-container { flex-direction: column; gap: 15px; padding: 15px; }
    .logo a { justify-content: center; }
    nav ul { flex-wrap: wrap; justify-content: center; gap: 15px; width: 100%; }
    nav a { font-size: 0.85rem; }

    /* Hero: Adjust Text Size */
    .hero { height: auto; min-height: 400px; padding: 60px 0; }
    .hero h1 { font-size: 2.2rem; line-height: 1.2; }
    .btn { padding: 12px 25px; font-size: 0.9rem; margin-bottom: 10px; }
    .btn-outline { margin-left: 0; margin-top: 10px; display: inline-flex; } /* Stack buttons if needed */

    /* Container: Less padding */
    .container { padding: 40px 15px; }

    /* Grid: Force 1 column on mobile to prevent squishing */
    .grid { grid-template-columns: 1fr; gap: 20px; }
    
    /* Contact & Footer */
    .contact-container { grid-template-columns: 1fr; }
    .contact-left, .contact-right { padding: 25px; }
    .footer-wrapper { padding: 0 20px; gap: 30px; grid-template-columns: 1fr; }
    
    /* Adjust Card Image Height */
    .card-img-wrapper { height: 200px; }
}

.about-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-bottom: 80px;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.about-text p {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.8;
}

.about-img {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: 500px;
}

.about-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The Values Grid (3 Icons) */
.values-section {
    background: white;
    padding: 60px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.value-card {
    padding: 20px;
}

.value-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 15px;
    display: inline-block;
    background: #FFFBEB;
    padding: 20px;
    border-radius: 50%;
}

/* Mobile Fix for About Page */
@media (max-width: 768px) {
    .about-split {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .about-img {
        height: 300px; /* Smaller image on mobile */
    }
}


/* --- Profile Page Layout --- */
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr; /* Sidebar fixed, History flexible */
    gap: 40px;
}

.profile-card {
    padding: 30px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

/* Order History Cards */
.order-card {
    padding: 0;
    margin-bottom: 25px;
}
.order-header {
    background: #f9fafb;
    padding: 15px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.order-id { font-weight: 700; color: var(--primary); margin-right: 15px; }
.order-date { font-size: 0.85rem; color: #888; }

.order-item {
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #f4f4f4;
}
.order-item:last-child { border-bottom: none; }
.order-item img {
    width: 60px; height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

/* The container for Links AND Avatar */
.main-nav {
    display: flex;
    align-items: center;
    gap: 30px; /* Space between links and avatar */
}

/* The List of Links */
.nav-links { 
    display: flex; 
    gap: 25px; 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.nav-links a { 
    font-weight: 500; 
    font-size: 0.95rem; 
    color: var(--text-main); 
    white-space: nowrap; 
}
.nav-links a:hover { color: var(--accent); }

/* The Avatar Icon Wrapper */
.user-menu {
    display: flex;
    align-items: center;
}

.avatar-btn {
    font-size: 1.6rem; /* Icon Size */
    color: var(--primary);
    transition: 0.3s;
    display: flex; 
    align-items: center;
    line-height: 1;
}

.avatar-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

/* Mobile Header Fixes */
@media (max-width: 768px) {
    .nav-container {
        padding: 15px;
    }
    
    /* On mobile, keep logo left and avatar right, hide links or stack them? */
    /* For now, let's keep them accessible but tidy */
    .nav-container {
        flex-wrap: wrap; 
    }
    
    .main-nav {
        width: 100%;
        justify-content: space-between;
        margin-top: 15px;
        order: 2; /* Moves nav below logo on tiny screens if needed */
    }
    
    .nav-links {
        gap: 15px;
        font-size: 0.85rem;
    }
}

/* ... existing styles ... */

/* --- AUTH PAGES (Login / Signup) --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1; /* Takes up all remaining vertical space */
    padding: 40px 20px;
    background: #f0f2f5; /* Slightly darker than body for contrast */
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 480px;
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    text-align: left;
    border: 1px solid rgba(0,0,0,0.02);
}

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}
.auth-header h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}
.auth-header p {
    color: #888;
    font-size: 0.95rem;
}

/* Modern Input Fields for Auth */
.auth-field {
    margin-bottom: 20px;
}
.auth-field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-field input, .auth-field textarea {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    font-size: 1rem;
    transition: all 0.2s;
}
.auth-field input:focus {
    background: white;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

/* Auth Divider */
.auth-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.95rem;
    color: #666;
}
.auth-footer a {
    color: var(--accent);
    font-weight: 700;
}
.auth-footer a:hover {
    text-decoration: underline;
}

/* --- AUTH BUTTON (Larger Text) --- */
.btn-auth {
    width: 100%;
    padding: 18px;
    border-radius: 12px;
    
    /* Bigger & Bolder Text */
    font-size: 1.2rem; 
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.25);
    transition: all 0.3s ease;
}

.btn-auth:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(245, 158, 11, 0.4);
}

/* --- Avatar Letter Style --- */
.avatar-letter {
    width: 40px; height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.2rem;
    text-decoration: none;
    transition: 0.3s;
}
.avatar-letter:hover { background: var(--accent); transform: scale(1.1); }

.profile-avatar-large {
    width: 80px; height: 80px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 2.5rem;
    margin: 0 auto 15px auto;
}

/* --- Smaller Auth Button --- */
.btn-auth-small {
    width: 100%;
    padding: 12px; /* Reduced from 18px */
    border-radius: 8px;
    font-size: 1rem; /* Reduced size */
    font-weight: 700;
    text-transform: uppercase;
    background: var(--accent);
    color: white; border: none; cursor: pointer;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
    transition: 0.3s;
}
.btn-auth-small:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* --- Address Styles --- */
.address-item {
    background: #f9fafb;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    position: relative;
    font-size: 0.9rem;
}
.delete-link {
    position: absolute; top: 5px; right: 8px;
    color: #ccc; font-size: 1.2rem;
    text-decoration: none;
}
.delete-link:hover { color: red; }

/* ... existing styles ... */

.delete-link {
    position: absolute; 
    top: 10px; 
    right: 10px;
    color: #ef4444; /* Red color */
    font-size: 1rem;
    padding: 5px;
    transition: 0.2s;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.delete-link:hover {
    color: #b91c1c;
    background: #fee2e2;
    transform: scale(1.1);
}

/* --- Custom Modal (Popup) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 2000;
    display: none; justify-content: center; align-items: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; animation: fadeIn 0.3s; }

.modal-box {
    background: white; width: 90%; max-width: 400px;
    padding: 30px; border-radius: 16px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    transform: scale(0.9); transition: 0.3s;
}
.modal-overlay.active .modal-box { transform: scale(1); }

.modal-icon { font-size: 3rem; margin-bottom: 15px; display: block; }
.modal-title { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.modal-text { color: #666; margin-bottom: 25px; font-size: 0.95rem; line-height: 1.5; }

.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-modal { padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; border: none; flex: 1; }
.btn-confirm { background: var(--accent); color: white; }
.btn-cancel { background: #f3f4f6; color: #333; }
.btn-danger { background: #ef4444; color: white; }

/* --- Edit Buttons --- */
.edit-btn {
    color: var(--accent); font-size: 0.9rem; margin-left: 10px; cursor: pointer;
}
.edit-btn:hover { text-decoration: underline; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Header Logo Section --- */
.logo a { 
    display: flex; 
    align-items: center; 
    gap: 15px; /* Space between the two images */
    text-decoration: none;
}

/* Style for BOTH images */
.logo img { 
    height: 65px; /* Adjust this to make them bigger/smaller */
    width: auto; 
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Specific style for the Company Photo to make it look distinct */
.company-photo {
    border-radius: 6px; /* Soft corners */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow */
    border: 1px solid rgba(0,0,0,0.05);
}

/* Hover Effect */
.logo a:hover .main-logo { transform: scale(1.05); }
.logo a:hover .company-photo { transform: scale(1.05); }


/* Mobile Adjustments */
@media (max-width: 768px) {
    .logo img { 
        height: 50px; /* Smaller on mobile so they fit side-by-side */
    }
    .logo a {
        gap: 10px;
    }
}