/* ====================================================
   AGRIVANA SOURCING — Public Stylesheet
   Design: Organic/Natural Agriculture theme
   Palette: Deep forest green, warm cream, earthy tones
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ===== RESET & ROOT ===== */
.ags-wrap { --ags-green: #1e6e42; --ags-green-mid: #2d9b5a; --ags-green-light: #4db97a; --ags-green-pale: #e8f5ee; --ags-green-xpale: #f2faf5; --ags-cream: #faf9f5; --ags-warm: #f0ece0; --ags-brown: #7c5c3e; --ags-text: #1a2318; --ags-text-muted: #6b7a68; --ags-border: #d4e6d9; --ags-white: #ffffff; --ags-shadow: 0 4px 24px rgba(30,110,66,.08); --ags-shadow-lg: 0 12px 48px rgba(30,110,66,.14); --ags-radius: 12px; --ags-radius-sm: 8px; font-family: 'DM Sans', sans-serif; color: var(--ags-text); }

.ags-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== HERO ===== */
.ags-hero { position: relative; background: linear-gradient(160deg, #0d3d20 0%, #1e6e42 45%, #2d9b5a 100%); padding: 80px 0 72px; overflow: hidden; }
.ags-hero__bg { position: absolute; inset: 0; pointer-events: none; }
.ags-hero__grain { position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E"); opacity: .4; }
.ags-hero__leaf { position: absolute; opacity: .12; }
.ags-hero__leaf--1 { bottom: -40px; right: -60px; width: 400px; height: 400px; background: radial-gradient(circle, #4db97a 0%, transparent 70%); }
.ags-hero__leaf--2 { top: -80px; right: 20%; width: 300px; height: 300px; background: radial-gradient(circle, #a8e6c0 0%, transparent 70%); }
.ags-hero__leaf--3 { bottom: 20px; left: -60px; width: 250px; height: 250px; background: radial-gradient(circle, #2d9b5a 0%, transparent 70%); }
.ags-hero__content { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.ags-hero__badge { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 50px; padding: 6px 16px; color: #b6edca; font-size: 13px; font-weight: 500; margin-bottom: 22px; backdrop-filter: blur(8px); }
.ags-hero__title { font-family: 'Playfair Display', serif; font-size: clamp(36px, 5vw, 58px); font-weight: 700; color: #ffffff; line-height: 1.15; margin: 0 0 20px; }
.ags-hero__title span { color: #7ddea4; }
.ags-hero__desc { font-size: 17px; color: rgba(255,255,255,.8); line-height: 1.7; max-width: 560px; margin: 0 0 36px; }
.ags-hero__stats { display: flex; gap: 28px; margin-bottom: 36px; flex-wrap: wrap; }
.ags-stat { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); border-radius: var(--ags-radius-sm); padding: 12px 18px; backdrop-filter: blur(8px); }
.ags-stat__icon { width: 38px; height: 38px; background: rgba(255,255,255,.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #7ddea4; flex-shrink: 0; }
.ags-stat strong { display: block; color: #fff; font-size: 18px; font-weight: 700; }
.ags-stat span { color: rgba(255,255,255,.7); font-size: 12px; }
.ags-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.ags-btn { display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif; font-weight: 600; border-radius: var(--ags-radius-sm); transition: all .2s; text-decoration: none; }
.ags-btn--primary { background: var(--ags-green-light); color: #fff; padding: 11px 22px; font-size: 14px; }
.ags-btn--primary:hover { background: #3dc96b; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(77,185,122,.35); color: #fff; }
.ags-btn--lg { padding: 14px 28px; font-size: 15px; }
.ags-btn--ghost { background: rgba(255,255,255,.12); color: #fff; padding: 11px 22px; font-size: 14px; border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(6px); }
.ags-btn--ghost:hover { background: rgba(255,255,255,.2); color: #fff; }
.ags-btn--outline { background: transparent; color: var(--ags-green); border: 1.5px solid var(--ags-green); padding: 9px 18px; font-size: 13px; }
.ags-btn--outline:hover { background: var(--ags-green-pale); }
.ags-btn--danger { background: #fde8e8; color: #c0392b; padding: 9px 18px; font-size: 13px; }
.ags-btn--danger:hover { background: #f5c6c6; }

/* ===== HOW IT WORKS ===== */
.ags-how { background: var(--ags-cream); padding: 72px 0; }
.ags-section-label { text-transform: uppercase; letter-spacing: 2px; font-size: 11px; font-weight: 600; color: var(--ags-green-mid); margin-bottom: 10px; }
.ags-section-title { font-family: 'Playfair Display', serif; font-size: clamp(26px, 3.5vw, 38px); font-weight: 600; color: var(--ags-text); margin: 0 0 48px; }
.ags-how__grid { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: start; gap: 0; }
.ags-how__step { background: var(--ags-white); border: 1px solid var(--ags-border); border-radius: var(--ags-radius); padding: 28px 24px; position: relative; transition: all .25s; }
.ags-how__step:hover { transform: translateY(-4px); box-shadow: var(--ags-shadow); }
.ags-how__icon { width: 56px; height: 56px; background: var(--ags-green-pale); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--ags-green); margin-bottom: 16px; }
.ags-how__num { font-family: 'Playfair Display', serif; font-size: 42px; font-weight: 700; color: var(--ags-border); line-height: 1; margin-bottom: 12px; }
.ags-how__step h3 { font-size: 17px; font-weight: 600; color: var(--ags-text); margin: 0 0 10px; }
.ags-how__step p { font-size: 14px; color: var(--ags-text-muted); line-height: 1.65; margin: 0; }
.ags-how__connector { display: flex; align-items: center; justify-content: center; padding: 0 12px; margin-top: 40px; color: var(--ags-border); }

/* ===== REQUESTS SECTION ===== */
.ags-requests-section { background: var(--ags-white); padding: 72px 0; }
.ags-requests-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; }

/* Filters */
.ags-filters { display: flex; gap: 12px; margin-bottom: 32px; flex-wrap: wrap; }
.ags-filter-search { flex: 1; min-width: 240px; position: relative; }
.ags-filter-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ags-text-muted); pointer-events: none; }
.ags-filter-search .ags-input { padding-left: 40px; }

/* Inputs */
.ags-input, .ags-select, .ags-textarea { width: 100%; border: 1.5px solid var(--ags-border); border-radius: var(--ags-radius-sm); padding: 10px 14px; font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--ags-text); background: var(--ags-white); transition: border .2s, box-shadow .2s; outline: none; box-sizing: border-box; }
.ags-input:focus, .ags-select:focus, .ags-textarea:focus { border-color: var(--ags-green-mid); box-shadow: 0 0 0 3px rgba(45,155,90,.1); }
.ags-select { cursor: pointer; }
.ags-textarea { resize: vertical; min-height: 80px; }

/* Grid */
.ags-requests-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; min-height: 200px; }

/* Request Card */
.ags-request-card { background: var(--ags-white); border: 1.5px solid var(--ags-border); border-radius: var(--ags-radius); overflow: hidden; transition: all .25s; cursor: pointer; }
.ags-request-card:hover { transform: translateY(-4px); box-shadow: var(--ags-shadow-lg); border-color: var(--ags-green-light); }
.ags-request-card__img { height: 160px; object-fit: cover; width: 100%; display: block; }
.ags-request-card__img-placeholder { height: 160px; background: linear-gradient(135deg, var(--ags-green-pale), var(--ags-warm)); display: flex; align-items: center; justify-content: center; color: var(--ags-green-mid); }
.ags-request-card__body { padding: 18px 20px; }
.ags-request-card__meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ags-request-card__title { font-size: 16px; font-weight: 600; color: var(--ags-text); margin: 0 0 8px; line-height: 1.4; }
.ags-request-card__desc { font-size: 13px; color: var(--ags-text-muted); line-height: 1.55; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ags-request-card__footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--ags-border); }
.ags-request-card__offers { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ags-green); }
.ags-request-card__offers svg { color: var(--ags-green-light); }
.ags-request-card__time { font-size: 12px; color: var(--ags-text-muted); }
.ags-request-card__info { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ags-flag-inline { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ags-text-muted); }
.ags-flag-inline img { border-radius: 2px; }

/* Tags / Pills */
.ags-tag { display: inline-block; background: var(--ags-green-pale); color: var(--ags-green); padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.ags-tag--brown { background: #f5ece0; color: #7c5c3e; }
.ags-tag--qty { background: #f0f5ff; color: #3b5bbd; }

/* Urgency */
.ags-urgency { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.ags-urgency::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: block; }
.ags-urgency--urgent { background: #fde8e8; color: #c0392b; }
.ags-urgency--urgent::before { background: #c0392b; }
.ags-urgency--high { background: #fff0d9; color: #d4780a; }
.ags-urgency--high::before { background: #d4780a; }
.ags-urgency--normal { background: var(--ags-green-pale); color: var(--ags-green); }
.ags-urgency--normal::before { background: var(--ags-green); }
.ags-urgency--low { background: #f4f5f7; color: #5e6c84; }
.ags-urgency--low::before { background: #5e6c84; }

/* Pagination */
.ags-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.ags-pagination__btn { width: 38px; height: 38px; border: 1.5px solid var(--ags-border); border-radius: var(--ags-radius-sm); background: #fff; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ags-text); transition: all .2s; display: flex; align-items: center; justify-content: center; font-family: 'DM Sans', sans-serif; }
.ags-pagination__btn:hover, .ags-pagination__btn.active { background: var(--ags-green); border-color: var(--ags-green); color: #fff; }

/* ===== MODAL ===== */
.ags-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .25s; padding: 20px; }
.ags-modal.open { opacity: 1; pointer-events: all; }
.ags-modal__backdrop { position: absolute; inset: 0; background: rgba(5, 18, 8, 0.72); }
.ags-modal__box { position: relative; background: #ffffff; border-radius: 16px; width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,.3); transform: translateY(20px) scale(.98); transition: transform .3s; }
.ags-modal.open .ags-modal__box { transform: translateY(0) scale(1); }
.ags-modal__box--view { max-width: 680px; }
.ags-modal__header { padding: 24px 24px 18px; position: sticky; top: 0; background: #ffffff; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1.5px solid var(--ags-border); }
.ags-modal__tag { display: inline-flex; align-items: center; gap: 6px; background: var(--ags-green-pale); color: var(--ags-green); padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.ags-modal__title { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; color: var(--ags-text); margin: 0 0 4px; }
.ags-modal__subtitle { font-size: 13px; color: var(--ags-text-muted); margin: 0; }
.ags-modal__close { width: 34px; height: 34px; border: 1.5px solid var(--ags-border); border-radius: 8px; background: #fff; cursor: pointer; color: var(--ags-text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: 12px; transition: all .2s; }
.ags-modal__close:hover { background: var(--ags-green-pale); border-color: var(--ags-green-light); color: var(--ags-green); }
.ags-modal__body { padding: 20px 24px 24px; background: #ffffff; }

/* Form Layout */
.ags-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ags-form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.ags-form-group--full { grid-column: 1 / -1; }
.ags-form-group label { font-size: 12px; font-weight: 700; color: var(--ags-text); text-transform: uppercase; letter-spacing: .4px; }
.ags-form-group label .req { color: #c0392b; }

/* Image upload zone — compact */
.ags-image-upload-zone { border: 2px dashed var(--ags-border); border-radius: var(--ags-radius); overflow: hidden; cursor: pointer; transition: all .2s; margin-bottom: 16px; display: flex; align-items: center; justify-content: center; background: var(--ags-green-xpale); }
.ags-image-upload-zone:hover { border-color: var(--ags-green-mid); background: #e4f5eb; }
.ags-image-upload-zone__placeholder { display: flex; flex-direction: row; align-items: center; gap: 14px; color: var(--ags-text-muted); padding: 16px 20px; width: 100%; }
.ags-image-upload-zone__placeholder svg { color: var(--ags-green-light); flex-shrink: 0; }
.ags-image-upload-zone__placeholder span { font-size: 14px; font-weight: 600; color: var(--ags-text); display: block; margin-bottom: 2px; }
.ags-image-upload-zone__placeholder small { font-size: 12px; color: var(--ags-text-muted); display: block; }
.ags-image-upload-zone__preview { width: 100%; height: 160px; object-fit: cover; display: block; }

/* Form notice */
.ags-form__notice { display: flex; align-items: flex-start; gap: 10px; background: #fff8e6; border: 1px solid #f0c040; border-radius: var(--ags-radius-sm); padding: 12px 16px; font-size: 13px; color: #7a5c00; margin-bottom: 20px; line-height: 1.5; }
.ags-form__notice svg { flex-shrink: 0; color: #d4780a; margin-top: 1px; }

/* Form actions */
.ags-form-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ===== VIEW REQUEST MODAL CONTENT ===== */
.ags-view-request { }
.ags-view-request__img { width: 100%; height: 220px; object-fit: cover; }
.ags-view-request__img-placeholder { height: 120px; background: linear-gradient(135deg, var(--ags-green-pale), var(--ags-warm)); display: flex; align-items: center; justify-content: center; color: var(--ags-green-mid); }
.ags-view-request__body { padding: 24px 28px; }
.ags-view-request__meta-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ags-view-request__title { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 600; color: var(--ags-text); margin: 0 0 12px; }
.ags-view-request__desc { font-size: 14px; color: var(--ags-text-muted); line-height: 1.65; margin-bottom: 20px; }
.ags-view-request__details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: var(--ags-green-xpale); border: 1px solid var(--ags-border); border-radius: var(--ags-radius); padding: 16px; margin-bottom: 20px; }
.ags-detail-item { }
.ags-detail-item__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ags-text-muted); margin-bottom: 4px; }
.ags-detail-item__val { font-size: 14px; font-weight: 600; color: var(--ags-text); }
.ags-detail-item__val--highlight { color: var(--ags-green); }

/* Offer form inline */
.ags-offer-section { border-top: 1px solid var(--ags-border); padding-top: 20px; margin-top: 4px; }
.ags-offer-section h4 { font-size: 16px; font-weight: 600; color: var(--ags-text); margin: 0 0 16px; }
.ags-offer-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ags-contact-bar { display: flex; align-items: center; gap: 10px; background: var(--ags-green-pale); border-radius: var(--ags-radius-sm); padding: 12px 16px; margin-top: 12px; font-size: 13px; color: var(--ags-green); }
.ags-contact-bar svg { flex-shrink: 0; }
.ags-contact-bar strong { color: var(--ags-text); }

/* ===== LOADING & SPINNER ===== */
.ags-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 48px; color: var(--ags-text-muted); font-size: 14px; width: 100%; grid-column: 1 / -1; }
.ags-spinner { width: 36px; height: 36px; border: 3px solid var(--ags-border); border-top-color: var(--ags-green); border-radius: 50%; animation: ags-spin .8s linear infinite; }
@keyframes ags-spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.ags-empty { text-align: center; padding: 60px 24px; grid-column: 1 / -1; color: var(--ags-text-muted); }
.ags-empty svg { color: var(--ags-border); margin-bottom: 16px; }
.ags-empty h3 { font-size: 18px; font-weight: 600; color: var(--ags-text); margin: 0 0 8px; }
.ags-empty p { font-size: 14px; margin: 0; }

/* ===== TOAST ===== */
.ags-toast { position: fixed; bottom: 28px; right: 28px; background: #fff; border-radius: var(--ags-radius); box-shadow: var(--ags-shadow-lg); padding: 14px 20px; display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 420px; z-index: 200000; transform: translateY(100px); opacity: 0; transition: all .3s; border-left: 4px solid var(--ags-green); }
.ags-toast.show { transform: translateY(0); opacity: 1; }
.ags-toast.error { border-left-color: #c0392b; }
.ags-toast__icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--ags-green-pale); color: var(--ags-green); }
.ags-toast.error .ags-toast__icon { background: #fde8e8; color: #c0392b; }
.ags-toast__msg { font-size: 14px; font-weight: 500; color: var(--ags-text); line-height: 1.45; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .ags-how__grid { grid-template-columns: 1fr; }
    .ags-how__connector { display: none; }
    .ags-requests-grid { grid-template-columns: 1fr; }
    .ags-form-row { grid-template-columns: 1fr; }
    .ags-view-request__details { grid-template-columns: 1fr; }
    .ags-offer-form__row { grid-template-columns: 1fr; }
    .ags-hero__stats { gap: 12px; }
    .ags-stat { flex: 1; min-width: 120px; }
}
