/* Enhanced Responsive Design & Styling System */

:root {
    --brand: #008a00;
    --brand-dark: #006d00;
    --brand-yellow: #ffbf00;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-light);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

h1 {
    font-size: clamp(1.5rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.25rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.1rem, 3vw, 1.875rem);
}

p {
    margin: 0;
    color: var(--text-secondary);
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--brand-dark);
}

/* ============ CONTAINERS ============ */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

/* ============ HEADER ============ */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    box-shadow: var(--shadow-lg);
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 70px;
}

@media (min-width: 768px) {
    header .container {
        height: 90px;
    }
}

/* ============ BUTTONS ============ */
button, .btn {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(0.75rem, 2vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary {
    background-color: var(--brand);
    color: white;
}

.btn-primary:hover {
    background-color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--brand);
    border: 2px solid var(--brand);
}

.btn-secondary:hover {
    background-color: var(--brand);
    color: white;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

@media (min-width: 1024px) {
    .btn-icon:hover {
        transform: scale(1.1);
    }
}

/* ============ FORMS ============ */
input, textarea, select {
    font-family: 'Montserrat', sans-serif;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 138, 0, 0.1);
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: clamp(1rem, 4vw, 1.5rem);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background-color: #f1f5f9;
    border-radius: 0.5rem;
    object-fit: contain;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.product-image:hover {
    transform: scale(1.05);
}

.product-title {
    font-size: clamp(0.75rem, 2vw, 0.95rem);
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: clamp(0.875rem, 2.5vw, 1.25rem);
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.25rem;
}

.product-original-price {
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    color: var(--text-secondary);
    text-decoration: line-through;
}

/* ============ GRID LAYOUTS ============ */
.grid {
    display: grid;
    gap: clamp(1rem, 4vw, 1.5rem);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (min-width: 640px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============ FLEXBOX UTILITIES ============ */
.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

/* ============ SPACING ============ */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

.m-0 { margin: 0; }
.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* ============ MOBILE MENU ============ */
.mobile-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

@media (min-width: 1024px) {
    .mobile-menu-button {
        display: none;
    }
}

/* ============ SIDEBAR ============ */
.sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 500;
}

.sidebar.open {
    display: block;
}

.sidebar-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background-color: var(--brand-dark);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 501;
}

.sidebar.open .sidebar-content {
    transform: translateX(0);
}

@media (min-width: 1024px) {
    .sidebar {
        display: none !important;
    }
}

/* ============ HERO SECTION ============ */
.hero {
    position: relative;
    width: 100%;
    min-height: clamp(300px, 60vh, 500px);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

@media (min-width: 768px) {
    .hero-content {
        text-align: left;
        padding: 4rem;
    }
}

/* ============ ANIMATIONS ============ */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-in {
    animation: slideInUp 0.5s ease-out;
}

.animate-fade {
    animation: fadeIn 0.3s ease-in;
}

/* ============ UTILITY CLASSES ============ */
.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.rounded {
    border-radius: 0.5rem;
}

.rounded-lg {
    border-radius: 1rem;
}

.rounded-full {
    border-radius: 9999px;
}

.shadow {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* ============ ACCESSIBILITY ============ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============ PRINT STYLES ============ */
@media print {
    body {
        background: white;
    }
    .no-print {
        display: none;
    }
}

/* ============ DARK MODE (Optional) ============ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #0f172a;
        --bg-white: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --border-color: #334155;
    }
}
/* ============ SWEETALERT2 PREMIUM OVERRIDES ============ */
.swal2-container {
    z-index: 9999 !important;
}

.swal2-popup {
    border-radius: 1.5rem !important;
    padding: 1.5rem !important;
    background: var(--bg-white) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 40px 80px -10px rgba(0,0,0,0.15) !important;
    width: auto !important;
    max-width: 90vw !important;
}

@media (min-width: 768px) {
    .swal2-popup {
        border-radius: 2.5rem !important;
        padding: 2.5rem !important;
    }
}

.swal2-toast {
    padding: 1rem !important;
    border-radius: 1rem !important;
    max-width: 90vw !important;
    width: max-content !important;
}

.swal2-toast .swal2-title {
    font-size: 0.85rem !important;
}

@media (min-width: 768px) {
    .swal2-toast {
        max-width: 350px !important;
        padding: 1.25rem !important;
    }
    .swal2-toast .swal2-title {
        font-size: 0.95rem !important;
    }
}

.swal2-title {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em !important;
    color: var(--text-primary) !important;
}

.swal2-html-container {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
}

.swal2-confirm {
    background: var(--brand) !important;
    border-radius: 1.25rem !important;
    padding: 1rem 2rem !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    font-size: 0.75rem !important;
    box-shadow: 0 10px 20px rgba(0, 138, 0, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.swal2-confirm:hover {
    background: var(--brand-dark) !important;
    transform: translateY(-2px) !important;
}

.swal2-cancel {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: 2px solid var(--border-color) !important;
    border-radius: 1.25rem !important;
    padding: 1rem 2rem !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    font-size: 0.75rem !important;
    transition: all 0.3s ease !important;
}

.swal2-cancel:hover {
    background: var(--bg-light) !important;
    border-color: var(--text-secondary) !important;
}

.swal2-icon {
    border-width: 3px !important;
    margin-top: 1rem !important;
    margin-bottom: 2rem !important;
}

.swal2-icon.swal2-success {
    border-color: var(--brand) !important;
    color: var(--brand) !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--brand) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border: .25em solid rgba(0, 138, 0, .3) !important;
}

.swal2-actions {
    gap: 1rem !important;
    margin-top: 2rem !important;
}

.ts-wrapper.single .ts-control:after { display: none !important; }
