/*
Theme Name: Storefront SaaS
Theme URI: https://yourdomain.com/storefront-saas
Author: Your Name
Author URI: https://yourdomain.com
Template: storefront
Version: 1.0.0
License: GNU General Public License v3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: storefront-saas
*/

:root {
  --saas-primary: #2563eb;
  --saas-primary-hover: #1d4ed8;
  --saas-secondary: #64748b;
  --saas-accent: #f59e0b;
  --saas-success: #10b981;
  --saas-warning: #f59e0b;
  --saas-error: #ef4444;
  --saas-white: #ffffff;
  --saas-gray-50: #f8fafc;
  --saas-gray-100: #f1f5f9;
  --saas-gray-200: #e2e8f0;
  --saas-gray-300: #cbd5e1;
  --saas-gray-400: #94a3b8;
  --saas-gray-500: #64748b;
  --saas-gray-600: #475569;
  --saas-gray-700: #334155;
  --saas-gray-800: #1e293b;
  --saas-gray-900: #0f172a;
  --saas-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --saas-space-1: 0.25rem;
  --saas-space-2: 0.5rem;
  --saas-space-3: 0.75rem;
  --saas-space-4: 1rem;
  --saas-space-6: 1.5rem;
  --saas-space-8: 2rem;
  --saas-space-12: 3rem;
  --saas-space-16: 4rem;
  --saas-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --saas-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --saas-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --saas-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --saas-shadow-product: 0 4px 20px -2px rgb(0 0 0 / 0.08);
  --saas-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --saas-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --saas-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --saas-radius-sm: 0.375rem;
  --saas-radius-md: 0.5rem;
  --saas-radius-lg: 0.75rem;
  --saas-radius-xl: 1rem;
  --saas-radius-full: 9999px;
  --saas-z-dropdown: 100;
  --saas-z-sticky: 200;
  --saas-z-drawer: 300;
  --saas-z-modal: 400;
  --saas-z-toast: 500;
}
/* ============================================
   GLOBAL RESET - REMOVE DEFAULT GAPS
   ============================================ */

html, body {
    margin: 0 !important;
    padding: 0 !important;
}

#page,
.site,
.hfeed {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* WordPress admin bar fix */
#wpadminbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--saas-font-sans); color: var(--saas-gray-800); background-color: var(--saas-gray-50); line-height: 1.6; overflow-x: hidden; margin: 0; }

/* Loading States */
.saas-loading { position: relative; pointer-events: none; opacity: 0.7; }
.saas-loading::after { content: ''; position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 2px solid var(--saas-gray-200); border-top-color: var(--saas-primary); border-radius: 50%; animation: saas-spin 0.6s linear infinite; }
@keyframes saas-spin { to { transform: rotate(360deg); } }

/* Toast Notifications */
.saas-toast-container { position: fixed; top: var(--saas-space-4); right: var(--saas-space-4); z-index: var(--saas-z-toast); display: flex; flex-direction: column; gap: var(--saas-space-2); pointer-events: none; }
.saas-toast { background: var(--saas-white); border-radius: var(--saas-radius-lg); box-shadow: var(--saas-shadow-xl); padding: var(--saas-space-4) var(--saas-space-6); display: flex; align-items: center; gap: var(--saas-space-3); min-width: 300px; max-width: 400px; transform: translateX(120%); transition: transform var(--saas-transition-base); pointer-events: auto; border-left: 4px solid var(--saas-primary); }
.saas-toast.show { transform: translateX(0); }
.saas-toast.success { border-left-color: var(--saas-success); }
.saas-toast.error { border-left-color: var(--saas-error); }
.saas-toast.warning { border-left-color: var(--saas-warning); }
.saas-toast-icon { width: 24px; height: 24px; flex-shrink: 0; }
.saas-toast-content { flex: 1; }
.saas-toast-title { font-weight: 600; font-size: 0.875rem; color: var(--saas-gray-900); margin: 0 0 var(--saas-space-1); }
.saas-toast-message { font-size: 0.8125rem; color: var(--saas-gray-500); margin: 0; }
.saas-toast-close { background: none; border: none; color: var(--saas-gray-400); cursor: pointer; padding: var(--saas-space-1); border-radius: var(--saas-radius-sm); transition: color var(--saas-transition-fast); }
.saas-toast-close:hover { color: var(--saas-gray-600); }

/* Quantity Input */
.saas-quantity { display: inline-flex; align-items: center; border: 1px solid var(--saas-gray-200); border-radius: var(--saas-radius-md); overflow: hidden; background: var(--saas-white); }
.saas-quantity button { width: 36px; height: 36px; background: var(--saas-gray-50); border: none; color: var(--saas-gray-600); cursor: pointer; font-size: 1.125rem; transition: all var(--saas-transition-fast); display: flex; align-items: center; justify-content: center; }
.saas-quantity button:hover { background: var(--saas-gray-100); color: var(--saas-gray-900); }
.saas-quantity button:disabled { opacity: 0.4; cursor: not-allowed; }
.saas-quantity input { width: 50px; height: 36px; border: none; text-align: center; font-weight: 600; color: var(--saas-gray-800); -moz-appearance: textfield; }
.saas-quantity input::-webkit-outer-spin-button, .saas-quantity input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Badges */
.saas-badge { display: inline-flex; align-items: center; padding: var(--saas-space-1) var(--saas-space-2); border-radius: var(--saas-radius-full); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.025em; }
.saas-badge--sale { background: var(--saas-error); color: var(--saas-white); }
.saas-badge--new { background: var(--saas-success); color: var(--saas-white); }
.saas-badge--bestseller { background: var(--saas-accent); color: var(--saas-white); }

/* Buttons */
.saas-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--saas-space-2); padding: var(--saas-space-3) var(--saas-space-6); border-radius: var(--saas-radius-lg); font-weight: 600; font-size: 0.9375rem; cursor: pointer; transition: all var(--saas-transition-fast); border: none; text-decoration: none; }
.saas-btn--primary { background: var(--saas-primary); color: var(--saas-white); }
.saas-btn--primary:hover { background: var(--saas-primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgb(37 99 235 / 0.3); }
.saas-btn--primary:active { transform: translateY(0); }
.saas-btn--secondary { background: var(--saas-gray-100); color: var(--saas-gray-700); }
.saas-btn--secondary:hover { background: var(--saas-gray-200); }
.saas-btn--ghost { background: transparent; color: var(--saas-gray-600); border: 1px solid var(--saas-gray-200); }
.saas-btn--ghost:hover { background: var(--saas-gray-50); color: var(--saas-gray-900); }
.saas-btn--full { width: 100%; }
.saas-btn--icon { width: 44px; height: 44px; padding: 0; border-radius: var(--saas-radius-full); background: var(--saas-white); color: var(--saas-gray-700); }
.saas-btn--icon:hover { background: var(--saas-gray-100); transform: scale(1.1); }
.saas-btn--disabled { background: var(--saas-gray-200); color: var(--saas-gray-400); cursor: not-allowed; }
.saas-btn__icon { display: flex; align-items: center; justify-content: center; }

/* Content Visibility for Performance */
.site-content { content-visibility: auto; contain-intrinsic-size: 0 500px; }

/* WooCommerce Overrides */
.woocommerce .col-full { max-width: 1280px; padding: 0 var(--saas-space-6); }
.woocommerce-breadcrumb { background: var(--saas-white); padding: var(--saas-space-4) 0; margin-bottom: 0; font-size: 0.875rem; }
.woocommerce-breadcrumb a { color: var(--saas-gray-500); text-decoration: none; }
.woocommerce-breadcrumb a:hover { color: var(--saas-primary); }
