/* Custom Theme Optimizations */

/* Preload critical fonts */
@font-face {
    font-family: 'Montserrat';
    font-display: swap;
    src: url('{{ asset("theme/fonts/Montserrat/Montserrat-Regular.ttf") }}') format('truetype');
}

@font-face {
    font-family: 'PlayfairDisplay';
    font-display: swap;
    src: url('{{ asset("theme/fonts/PlayfairDisplay/PlayfairDisplay-Regular.ttf") }}') format('truetype');
}

@font-face {
    font-family: 'Poppins';
    font-display: swap;
    src: url('{{ asset("theme/fonts/Poppins/Poppins-Regular.ttf") }}') format('truetype');
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Cart sidebar improvements */
.wrap-header-cart {
    will-change: transform;
    transform: translateZ(0);
}

/* Product grid optimizations */
.isotope-grid {
    contain: layout;
}

.block2 {
    contain: layout style;
}

/* Animation optimizations */
.trans-04 {
    transition: all 0.4s ease;
    will-change: transform, opacity;
}

.hov-cl1:hover {
    color: #717fe0 !important;
}

.hov-btn1:hover {
    background-color: #717fe0 !important;
    border-color: #717fe0 !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .wrap-menu-desktop {
        display: none;
    }
    
    .wrap-header-mobile {
        display: flex;
    }
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .wrap-header-mobile {
        display: none;
    }
    
    .wrap-menu-desktop {
        display: block;
    }
}

/* Color swatch styles */
.color-swatch {
    border: 2px solid #ddd !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    padding: 0 !important;
    margin: 2px !important;
}

.color-swatch:hover,
.color-swatch:checked + label {
    border-color: #717fe0 !important;
    box-shadow: 0 0 0 2px rgba(113, 127, 224, 0.3) !important;
}

.variation-chip {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    margin: 2px !important;
    background: #fff !important;
    color: #333 !important;
}

.variation-chip:hover,
.variation-chip:checked + label {
    border-color: #717fe0 !important;
    background: #717fe0 !important;
    color: #fff !important;
}

/* Hide radio buttons */
input[type="radio"] {
    display: none !important;
}

input[type="radio"]:checked + label {
    border-color: #717fe0 !important;
    background: #717fe0 !important;
    color: #fff !important;
}

/* Form improvements */
.form-control:focus {
    border-color: #717fe0;
    box-shadow: 0 0 0 0.2rem rgba(113, 127, 224, 0.25);
}

/* Button improvements */
.btn-primary {
    background-color: #717fe0;
    border-color: #717fe0;
}

.btn-primary:hover {
    background-color: #5a67d8;
    border-color: #5a67d8;
}

/* Alert styles */
.alert {
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #717fe0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive images */
.responsive-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

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

/* Flex utilities */
.d-flex {
    display: flex;
}

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

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

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

/* Spacing utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

/* Text utilities */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.text-primary { color: #717fe0 !important; }
.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-warning { color: #ffc107 !important; }
.text-info { color: #17a2b8 !important; }
.text-muted { color: #6c757d !important; }


/* Logo sizing overrides */
.header-v4 .logo {
    height: 80% !important;
}

.header-v4 .logo img {
    max-height: 72px !important;
}

.logo-mobile {
    height: 90% !important;
}

.logo-mobile img {
    max-height: 90% !important;
}

