/**
 * ShopUHIV - Utility Classes
 * Утилитарные классы для быстрой стилизации
 * Основано на lite.css, но с использованием CSS переменных
 */

/* ────────────────────────────────────────────
   LAYOUT UTILITIES
   ──────────────────────────────────────────── */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-grow {
    flex: 1 1 0%;
}

.flex-1 {
    flex: 1 1 0%;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.space-x-2 > * + * {
    margin-left: var(--spacing-2);
}

.space-y-1 > * + * {
    margin-top: var(--spacing-1);
}

.space-y-2 > * + * {
    margin-top: var(--spacing-2);
}

/* ────────────────────────────────────────────
   GRID SYSTEM
   ──────────────────────────────────────────── */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gap-4 {
    gap: var(--spacing-4);
}

.gap-6 {
    gap: var(--spacing-6);
}

.gap-2 {
    gap: var(--spacing-2);
}

/* Responsive Grid - будет в responsive.css */

/* ────────────────────────────────────────────
   POSITIONING
   ──────────────────────────────────────────── */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.left-0 {
    left: 0;
}

.right-0 {
    right: 0;
}

.bottom-0 {
    bottom: 0;
}

.z-50 {
    z-index: var(--z-fixed);
}

.z-9999 {
    z-index: var(--z-loading);
}

/* ────────────────────────────────────────────
   SIZING
   ──────────────────────────────────────────── */
.w-full {
    width: 100%;
}

.w-6 {
    width: 1.5rem;
}

.w-8 {
    width: 2rem;
}

.h-6 {
    height: 1.5rem;
}

.h-8 {
    height: 2rem;
}

.h-12 {
    height: var(--header-height);
}

.h-full {
    height: 100%;
}

.min-h-screen {
    min-height: 100vh;
}

/* ────────────────────────────────────────────
   SPACING
   ──────────────────────────────────────────── */
.p-2 {
    padding: var(--spacing-2);
}

.p-3 {
    padding: var(--spacing-3);
}

.p-4 {
    padding: var(--spacing-4);
}

.px-4 {
    padding-left: var(--spacing-4);
    padding-right: var(--spacing-4);
}

.py-2 {
    padding-top: var(--spacing-2);
    padding-bottom: var(--spacing-2);
}

.py-4 {
    padding-top: var(--spacing-4);
    padding-bottom: var(--spacing-4);
}

.m-2 {
    margin: var(--spacing-2);
}

.my-1 {
    margin-top: var(--spacing-1);
    margin-bottom: var(--spacing-1);
}

.my-2 {
    margin-top: var(--spacing-2);
    margin-bottom: var(--spacing-2);
}

.mb-2 {
    margin-bottom: var(--spacing-2);
}

.mb-4 {
    margin-bottom: var(--spacing-4);
}

.mb-6 {
    margin-bottom: var(--spacing-6);
}

.mb-8 {
    margin-bottom: var(--spacing-8);
}

.mt-2 {
    margin-top: var(--spacing-2);
}

.mt-4 {
    margin-top: var(--spacing-4);
}

.mt-6 {
    margin-top: var(--spacing-6);
}

.ml-2 {
    margin-left: var(--spacing-2);
}

/* ────────────────────────────────────────────
   TYPOGRAPHY
   ──────────────────────────────────────────── */
.text-xs {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-tight);
}

.text-sm {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.text-md {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
}

.text-lg {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
}

.text-xl {
    font-size: var(--font-size-xl);
    line-height: var(--line-height-relaxed);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.inline-block {
    display: inline-block;
}

/* Text Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-line-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ────────────────────────────────────────────
   COLORS
   ──────────────────────────────────────────── */
.bg-white {
    background-color: var(--color-bg-primary);
}

.bg-gray-100 {
    background-color: var(--color-bg-tertiary);
}

.bg-gray-200 {
    background-color: #e5e7eb;
}

.bg-blue-500 {
    background-color: var(--color-primary);
}

.bg-black {
    background-color: #000000;
}

.bg-red-500 {
    background-color: var(--color-error);
}

.bg-green-500 {
    background-color: var(--color-success);
}

/* ────────────────────────────────────────────
   GRADIENTS
   ──────────────────────────────────────────── */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-gray-100 {
    --tw-gradient-from: var(--color-bg-tertiary);
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(243, 244, 246, 0));
}

.via-gray-50 {
    --tw-gradient-stops: var(--tw-gradient-from), #f9fafb, var(--tw-gradient-to, rgba(249, 250, 251, 0));
}

.to-gray-200 {
    --tw-gradient-to: #e5e7eb;
}

.text-white {
    color: var(--color-text-inverse);
}

.text-black {
    color: #000000;
}

.text-gray-400 {
    color: var(--color-text-tertiary);
}

.text-gray-500 {
    color: var(--color-text-secondary);
}

.text-gray-600 {
    color: var(--color-text-secondary);
}

.text-gray-700 {
    color: #374151;
}

.text-gray-800 {
    color: #1f2937;
}

.text-gray-900 {
    color: var(--color-text-primary);
}

.text-blue-500 {
    color: var(--color-primary);
}

.hover\:text-gray-900:hover {
    color: var(--color-text-primary);
}

/* ────────────────────────────────────────────
   BORDERS
   ──────────────────────────────────────────── */
.border {
    border-width: 1px;
    border-style: solid;
}

.border-b {
    border-bottom-width: 1px;
    border-style: solid;
}

.border-t {
    border-top-width: 1px;
    border-style: solid;
}

.border-gray-300 {
    border-color: var(--color-border-medium);
}

.rounded {
    border-radius: var(--radius-sm);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-t-lg {
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: var(--radius-full);
}

.overflow-hidden {
    overflow: hidden;
}

/* ────────────────────────────────────────────
   OBJECT FIT
   ──────────────────────────────────────────── */
.object-cover {
    object-fit: cover;
}

/* ────────────────────────────────────────────
   MARGIN AUTO
   ──────────────────────────────────────────── */
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* ────────────────────────────────────────────
   LIST STYLES
   ──────────────────────────────────────────── */
.list-disc {
    list-style-type: disc;
}

.list-inside {
    list-style-position: inside;
}

/* ────────────────────────────────────────────
   MAX HEIGHT
   ──────────────────────────────────────────── */
.max-h-0 {
    max-height: 0;
}

/* ────────────────────────────────────────────
   EFFECTS
   ──────────────────────────────────────────── */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-up {
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -2px rgba(0, 0, 0, 0.06);
}

.transition {
    transition-property: all;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-transform {
    transition-property: transform;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-shadow {
    transition-property: box-shadow;
    transition-duration: var(--transition-base);
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.duration-300 {
    transition-duration: 300ms;
}

.ease-in-out {
    transition-timing-function: ease-in-out;
}

.hover\:scale-110:hover {
    transform: scale(1.1);
}

.hover\:shadow-lg:hover {
    box-shadow: var(--shadow-lg);
}

/* ────────────────────────────────────────────
   VISIBILITY
   ──────────────────────────────────────────── */
.hidden {
    display: none;
}

.opacity-0 {
    opacity: 0;
}

.opacity-1 {
    opacity: 1;
}

/* ────────────────────────────────────────────
   ASPECT RATIO
   ──────────────────────────────────────────── */
.aspect-square {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
}

.aspect-square > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

