/*
Theme Name: eSaran
Theme URI: https://example.com/backlink-store
Author: Your Name
Author URI: https://example.com
Description: Custom WordPress theme untuk toko backlink profesional dengan WooCommerce integration. Tampilan modern ala marketplace Shopee/Tokopedia.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: backlink-store
Tags: woocommerce, marketplace, e-commerce, custom-theme

Backlink Store Theme, Copyright 2024
Backlink Store Theme is distributed under the terms of the GNU GPL
*/

/**
 * Table of Contents:
 * 
 * 1.0 - Reset & Base
 * 2.0 - Typography
 * 3.0 - Layout
 * 4.0 - Header
 * 5.0 - Navigation
 * 6.0 - Product Grid
 * 7.0 - Product Card
 * 8.0 - Single Product
 * 9.0 - Checkout
 * 10.0 - Dashboard
 * 11.0 - Auth (Login/Register)
 * 12.0 - Footer
 * 13.0 - Utilities
 * 14.0 - Responsive
 */

/* ==========================================================================
   1.0 - Reset & Base
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-color: #ee4d2d;
    --primary-hover: #d73211;
    --secondary-color: #f5f5f5;
    --text-primary: #222;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #fafafa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* ==========================================================================
   2.0 - Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-sm);
}

/* ==========================================================================
   3.0 - Layout
   ========================================================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-wide {
    max-width: 1400px;
}

.container-narrow {
    max-width: 800px;
}

.site-main {
    min-height: 60vh;
    padding: var(--spacing-lg) 0;
}

/* ==========================================================================
   4.0 - Header
   ========================================================================== */

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.site-logo:hover {
    color: var(--primary-hover);
}

/* ==========================================================================
   5.0 - Navigation
   ========================================================================== */

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.main-navigation a {
    color: var(--text-primary);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.main-navigation a:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-login,
.btn-dashboard {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-login {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-login:hover {
    background: var(--primary-color);
    color: #fff;
}

.btn-dashboard {
    background: var(--primary-color);
    color: #fff;
}

.btn-dashboard:hover {
    background: var(--primary-hover);
}

/* ==========================================================================
   6.0 - Product Grid
   ========================================================================== */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* ==========================================================================
   7.0 - Product Card
   ========================================================================== */

.product-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.product-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.product-card-image {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #f8f8f8;
}

.product-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.product-card:hover .product-card-image img {
    transform: scale(1.08);
}

.product-card-body {
    padding: 14px 14px 10px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 1.55rem;
    font-weight: 600;
    margin: 0px 0 0px 0;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 10px 0;
}

.product-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.813rem;
    color: var(--text-secondary);
    margin-bottom: auto;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 3px;
}

.stars {
    color: #ffa500;
    font-size: 1rem;
}

.rating-count {
    color: var(--text-muted);
}

.product-sold {
    color: var(--text-muted);
}

.product-card-footer {
    padding: 0 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-order {
    display: block;
    width: 100%;
    padding: 11px 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.938rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    order: 1;
}

.btn-order:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 77, 45, 0.3);
    color: #fff;
}

.btn-order:active {
    transform: translateY(0);
}

.product-estimasi {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.813rem;
    color: var(--text-muted);
    padding: 0;
    order: 2;
}

.product-estimasi .icon {
    font-size: 0.938rem;
    opacity: 0.8;
}

/* Product card responsive */
@media (max-width: 768px) {
    .product-card-body {
        padding: 12px 12px 8px 12px;
    }
    
    .product-card-title {
        font-size: 0.938rem;
        min-height: 2.5em;
        margin-bottom: 0px;
    }
    
    .product-card-price {
        font-size: 1.3rem;
        margin-bottom: 0px;
    }
    
    .product-card-meta {
        font-size: 0.75rem;
        gap: 6px 10px;
    }
    
    .product-estimasi {
        font-size: 0.75rem;
    }
    
    .btn-order {
        font-size: 0.875rem;
        padding: 10px 14px;
    }
    
    .product-card-footer {
        padding: 0 12px 12px 12px;
        gap: 6px;
    }
}

/* ==========================================================================
   8.0 - Single Product
   ========================================================================== */

.single-product-wrapper {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.product-gallery {
    position: relative;
}

.product-main-image {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.product-info h1 {
    margin-bottom: var(--spacing-md);
}

.product-price-section {
    background: var(--secondary-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.product-price-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-meta-list {
    list-style: none;
    margin-bottom: var(--spacing-lg);
}

.product-meta-list li {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.product-meta-list li:last-child {
    border-bottom: none;
}

.product-description {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

.product-reviews {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   9.0 - Checkout
   ========================================================================== */

.checkout-wrapper {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.form-group label .required {
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================================================
   10.0 - Dashboard
   ========================================================================== */

.dashboard-wrapper {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.order-list {
    list-style: none;
}

.order-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-fast);
}

.order-item:hover {
    box-shadow: var(--shadow-md);
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.order-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-on-hold {
    background: #cce5ff;
    color: #004085;
}

.progress-bar-wrapper {
    margin-top: var(--spacing-sm);
}

.progress-bar {
    height: 8px;
    background: var(--secondary-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width var(--transition-normal);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ==========================================================================
   11.0 - Auth (Login/Register)
   ========================================================================== */

.auth-wrapper {
    max-width: 450px;
    margin: var(--spacing-xl) auto;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.auth-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-sm);
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-divider {
    text-align: center;
    margin: var(--spacing-lg) 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: #fff;
    padding: 0 var(--spacing-sm);
    position: relative;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.btn-google {
    width: 100%;
    padding: var(--spacing-sm);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-google:hover {
    background: var(--secondary-color);
}

.btn-primary {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ==========================================================================
   12.0 - Footer
   ========================================================================== */

.site-footer {
    background: #fff;
    border-top: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

.footer-content {
    text-align: center;
    color: var(--text-secondary);
}

/* ==========================================================================
   13.0 - Utilities
   ========================================================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

/* ==========================================================================
   14.0 - Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}