/**
 * Main Stylesheet - Public Frontend
 * Modern, responsive design with animations
 */

/* === CSS Variables === */
:root {
    --primary: #667eea;
    --primary-dark: #764ba2;
    --secondary: #f093fb;
    --secondary-dark: #f5576c;
    --success: #43e97b;
    --warning: #f5af19;
    --danger: #f5576c;
    --info: #4facfe;
    
    --text-dark: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--bg-light);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === Header === */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav a {
    font-weight: 500;
    transition: var(--transition);
}

.nav a:hover {
    color: var(--primary);
}

.nav a.active {
    color: var(--primary);
}

.btn-admin {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
}

/* === Hero === */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.95;
    animation: fadeInUp 0.6s ease 0.15;
}

.btn-hero {
    display: inline-block;
    background: white;
    color: var(--primary);
    padding: 14px 32px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* === Sections === */
.categories-section,
.products-section {
    padding: 60px 0;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

/* === Categories Grid === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.category-name {
    font-weight: 600;
    font-size: 16px;
}

/* === Products Grid === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.product-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: var(--bg-light);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 64px;
    opacity: 0.3;
}

.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    margin-bottom: 12px;
}

.price-original {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 14px;
    margin-right: 8px;
}

.price-sale {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.product-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
}

/* === Product Detail === */
.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}

.product-detail-image img {
    width: 100%;
    border-radius: var(--radius);
}

.product-detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.product-category {
    margin-bottom: 20px;
}

.product-category a {
    color: var(--primary);
    font-weight: 500;
}

.product-price-large {
    margin-bottom: 24px;
}

.price-original-large {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 18px;
    margin-right: 12px;
}

.discount-badge-large {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

.price-sale-large {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-top: 8px;
}

.product-short-desc {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.product-full-desc {
    margin-bottom: 24px;
}

.product-full-desc h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.product-stats-large {
    display: flex;
    gap: 24px;
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.btn-shopee {
    display: inline-block;
    background: linear-gradient(135deg, #ee4d2d 0%, #ff6a3d 100%);
    color: white;
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.btn-shopee:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* === Footer === */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-info h3 {
    margin-bottom: 12px;
}

.footer-info p {
    color: rgba(255,255,255,0.7);
}

.footer-links h4 {
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255,255,255,0.6);
}

/* === Utilities === */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 24px;
}

/* === Pagination === */
.pagination {
    margin: 40px 0;
}

.pagination-list {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
}

.pagination-link {
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.pagination-link:hover,
.pagination-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
