/**
 * Easy Suite Design System
 * Shared styles for all modules
 */

/* ==========================================
   BASE STYLES
   ========================================== */

.easysuite-wrap {
    font-family: var(--easy-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    color: var(--easy-text, #2D3748);
    line-height: 1.6;
}

.easysuite-wrap * {
    box-sizing: border-box;
}

/* ==========================================
   BUTTONS
   ========================================== */

.es-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--easy-radius, 8px);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.es-btn-primary {
    background: var(--easy-accent, #4FD1C5);
    color: var(--easy-primary-dark, #1A202C);
}

.es-btn-primary:hover {
    background: var(--easy-accent-hover, #38B2AC);
}

.es-btn-secondary {
    background: var(--easy-primary, #2D3748);
    color: #fff;
}

.es-btn-secondary:hover {
    background: var(--easy-primary-light, #4A5568);
}

.es-btn-outline {
    background: transparent;
    border: 2px solid var(--easy-border, #E2E8F0);
    color: var(--easy-text, #2D3748);
}

.es-btn-outline:hover {
    border-color: var(--easy-accent, #4FD1C5);
    color: var(--easy-accent, #4FD1C5);
}

.es-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.es-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.es-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   CARDS
   ========================================== */

.es-card {
    background: var(--easy-card, #fff);
    border-radius: var(--easy-radius-lg, 12px);
    box-shadow: var(--easy-shadow, 0 1px 3px rgba(0,0,0,0.08));
    overflow: hidden;
}

.es-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--easy-border, #E2E8F0);
}

.es-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.es-card-body {
    padding: 20px;
}

.es-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--easy-border, #E2E8F0);
    background: var(--easy-bg, #F7FAFC);
}

/* ==========================================
   FORMS
   ========================================== */

.es-form-group {
    margin-bottom: 20px;
}

.es-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--easy-text, #2D3748);
}

.es-form-input,
.es-form-select,
.es-form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--easy-border, #E2E8F0);
    border-radius: var(--easy-radius, 8px);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.15s;
    background: #fff;
}

.es-form-input:focus,
.es-form-select:focus,
.es-form-textarea:focus {
    outline: none;
    border-color: var(--easy-accent, #4FD1C5);
    box-shadow: 0 0 0 3px var(--easy-accent-light, #E6FFFA);
}

.es-form-input::placeholder {
    color: var(--easy-text-muted, #A0AEC0);
}

.es-form-help {
    font-size: 13px;
    color: var(--easy-text-light, #718096);
    margin-top: 6px;
}

.es-form-error {
    font-size: 13px;
    color: var(--easy-danger, #F56565);
    margin-top: 6px;
}

/* ==========================================
   BADGES
   ========================================== */

.es-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.es-badge-success {
    background: var(--easy-success-light, #C6F6D5);
    color: #166534;
}

.es-badge-warning {
    background: var(--easy-warning-light, #FEFCBF);
    color: #92400E;
}

.es-badge-danger {
    background: var(--easy-danger-light, #FED7D7);
    color: #991B1B;
}

.es-badge-info {
    background: var(--easy-info-light, #BEE3F8);
    color: #1E40AF;
}

.es-badge-neutral {
    background: var(--easy-bg-alt, #EDF2F7);
    color: var(--easy-text-light, #718096);
}

/* ==========================================
   ALERTS
   ========================================== */

.es-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--easy-radius, 8px);
    margin-bottom: 16px;
}

.es-alert-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.es-alert-success {
    background: var(--easy-success-light, #C6F6D5);
    color: #166534;
}

.es-alert-warning {
    background: var(--easy-warning-light, #FEFCBF);
    color: #92400E;
}

.es-alert-danger {
    background: var(--easy-danger-light, #FED7D7);
    color: #991B1B;
}

.es-alert-info {
    background: var(--easy-info-light, #BEE3F8);
    color: #1E40AF;
}

/* ==========================================
   GRID
   ========================================== */

.es-grid {
    display: grid;
    gap: 24px;
}

.es-grid-2 { grid-template-columns: repeat(2, 1fr); }
.es-grid-3 { grid-template-columns: repeat(3, 1fr); }
.es-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .es-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .es-grid-2,
    .es-grid-3,
    .es-grid-4 { grid-template-columns: 1fr; }
}

/* ==========================================
   PRODUCT CARD
   ========================================== */

.es-product-card {
    background: var(--easy-card, #fff);
    border-radius: var(--easy-radius-lg, 12px);
    overflow: hidden;
    box-shadow: var(--easy-shadow, 0 1px 3px rgba(0,0,0,0.08));
    transition: all 0.2s;
}

.es-product-card:hover {
    box-shadow: var(--easy-shadow-md, 0 4px 6px rgba(0,0,0,0.1));
    transform: translateY(-2px);
}

.es-product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--easy-bg-alt, #EDF2F7);
}

.es-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.es-product-info {
    padding: 16px;
}

.es-product-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--easy-text, #2D3748);
}

.es-product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--easy-accent-hover, #38B2AC);
}

.es-product-price-old {
    font-size: 14px;
    color: var(--easy-text-muted, #A0AEC0);
    text-decoration: line-through;
    margin-left: 8px;
}

/* ==========================================
   CART
   ========================================== */

.es-cart-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--easy-border, #E2E8F0);
}

.es-cart-item:last-child {
    border-bottom: none;
}

.es-cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--easy-radius, 8px);
    overflow: hidden;
    background: var(--easy-bg-alt, #EDF2F7);
}

.es-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.es-cart-item-details {
    flex: 1;
}

.es-cart-item-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.es-cart-item-meta {
    font-size: 13px;
    color: var(--easy-text-light, #718096);
}

.es-cart-item-price {
    font-weight: 600;
    color: var(--easy-accent-hover, #38B2AC);
}

.es-cart-totals {
    padding: 20px;
    background: var(--easy-bg, #F7FAFC);
    border-radius: var(--easy-radius, 8px);
}

.es-cart-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.es-cart-totals-row.total {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid var(--easy-border, #E2E8F0);
    padding-top: 16px;
    margin-top: 8px;
}

/* ==========================================
   QUANTITY INPUT
   ========================================== */

.es-quantity {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--easy-border, #E2E8F0);
    border-radius: var(--easy-radius, 8px);
    overflow: hidden;
}

.es-quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--easy-bg, #F7FAFC);
    cursor: pointer;
    font-size: 18px;
    color: var(--easy-text, #2D3748);
    transition: background 0.15s;
}

.es-quantity-btn:hover {
    background: var(--easy-bg-alt, #EDF2F7);
}

.es-quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.es-quantity-input:focus {
    outline: none;
}

/* ==========================================
   LOADING
   ========================================== */

.es-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.es-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--easy-border, #E2E8F0);
    border-top-color: var(--easy-accent, #4FD1C5);
    border-radius: 50%;
    animation: es-spin 0.8s linear infinite;
}

@keyframes es-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 640px) {
    .es-btn {
        width: 100%;
    }
    
    .es-cart-item {
        flex-wrap: wrap;
    }
    
    .es-cart-item-image {
        width: 60px;
        height: 60px;
    }
}
