/* Custom styles for Artisan Shawls */

/* Prevent layout shift from scrollbar + smooth scroll */
html {
    overflow-y: scroll;
    scroll-behavior: smooth;
}

/* Skip link - hidden until focused */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only.focus\:not-sr-only:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Focus styles for accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #b45309;
    outline-offset: 2px;
}

/* Remove outline for mouse users, keep for keyboard */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #b45309;
    outline-offset: 2px;
}

/* Line clamp utility for product descriptions */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom button hover effects */
button {
    transition: all 0.2s ease-in-out;
}

/* Product card hover effect - enhanced */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Product card image zoom on hover */
.product-card img {
    transition: transform 0.4s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

/* Cart animation */
@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.cart-slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Modal fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-fade-in {
    animation: fadeIn 0.2s ease-out;
}

/* Responsive image container */
.product-image-container {
    position: relative;
    overflow: hidden;
    padding-bottom: 100%; /* 1:1 aspect ratio */
}

.product-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Custom scrollbar for cart - matches theme */
#cartItems::-webkit-scrollbar {
    width: 8px;
}

#cartItems::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#cartItems::-webkit-scrollbar-thumb {
    background: #b45309;
    border-radius: 4px;
}

#cartItems::-webkit-scrollbar-thumb:hover {
    background: #92400e;
}

/* Loading state */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Zoom cursor */
.cursor-zoom-in {
    cursor: zoom-in;
}

.cursor-zoom-out {
    cursor: zoom-out;
}

/* Image gallery thumbnails */
#thumbnailGallery img {
    transition: opacity 0.2s ease;
}

#thumbnailGallery img:hover {
    opacity: 0.8;
}

/* Main product image hover effect */
#modalMainImage {
    transition: transform 0.3s ease;
}

#mainImageContainer:hover #modalMainImage {
    transform: scale(1.05);
}

/* Zoom modal */
#zoomModal {
    backdrop-filter: blur(5px);
}

#zoomedImage {
    max-width: 95%;
    max-height: 95vh;
}