/* Custom styles and animations supporting Tailwind utility classes */
/* Glassmorphism Design System v2 Preview */

:root {
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --glass-blur: blur(12px);
    
    --gold-primary: #c5a059;
}

/* Glass Utility Classes */

.modern-input {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    padding: 0.75rem 0 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1a1919 !important;
    font-size: 1rem;
}

.modern-input::placeholder {
    color: #a3a3a3;
    font-weight: 300;
}

.modern-input:focus {
    outline: none !important;
    border-bottom-color: var(--gold-primary) !important;
    box-shadow: none !important;
}

/* Specific styling for select dropdown to maintain minimalist look */
select.modern-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23c5a059' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0 center;
    background-repeat: no-repeat;
    background-size: 1.25rem 1.25rem;
    padding-right: 2rem !important;
    appearance: none;
}

.glass-card {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
}

.glass-modal-content {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 60px 0 rgba(0, 0, 0, 0.15);
}


/* Background Decorative Blobs */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: #faf9f8; /* Cream base */
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: blob-float 20s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.blob-1 {
    background: #c5a059; /* Gold */
    top: -10%;
    right: -10%;
    animation-delay: 0s;
}

.blob-2 {
    background: #ebd7af; /* Gold Light */
    bottom: -15%;
    left: -10%;
    animation-delay: -5s;
    width: 800px;
    height: 800px;
}

.blob-3 {
    background: #d4a373;
    top: 40%;
    left: 20%;
    animation-delay: -10s;
    width: 500px;
    height: 500px;
    opacity: 0.1;
}

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

html, body {
    overflow-x: hidden;
    scroll-behavior: smooth;
    width: 100%;
}

/* Micro Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Open state classes for JS toggling */
body.modal-open {
    overflow: hidden;
}

#product-modal.show {
    display: flex;
}

#product-modal.show #modal-panel {
    transform: scale(1);
    opacity: 1;
}

/* Ensure the close button stays fixed in the corner of the modal on mobile */
@media (max-width: 767px) {
    #modal-close {
        position: fixed;
        top: 2rem;
        right: 2rem;
    }
    
    /* Limit image height on small screens to save space */
    #product-modal .md\:w-1\/2.bg-white\/20 {
        max-height: 60vh;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Product Card Hover effects */
.product-card-img-wrapper img {
    transition: transform 0.6s ease;
}

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

.product-card .btn-quickview {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.product-card:hover .btn-quickview {
    opacity: 1;
    transform: translateY(0);
}

/* Active nav link — "You Are Here" highlight */
.nav-link .nav-underline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #c5a059; /* gold */
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link.is-active,
.nav-link:hover {
    color: #1a1919;
}

.nav-link.is-active .nav-underline,
.nav-link:hover .nav-underline {
    width: 100%;
}

/* Back to Top button */
#back-to-top {
    transition: opacity 0.3s ease, background-color 0.3s ease;
}
#back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* -----------------------------------------------------------------------
   Product Like Button
   ----------------------------------------------------------------------- */

/* Liked state — heart fills with rose and icon scales up with a pop */
.product-like-btn.is-liked {
    color: #f43f5e; /* rose-500 */
}

.product-like-btn.is-liked #product-like-icon {
    fill: #f43f5e;
    stroke: #f43f5e;
    animation: heart-pop 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes heart-pop {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.4); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* -----------------------------------------------------------------------
   Share Popover
   ----------------------------------------------------------------------- */

.product-share-popover {
    animation: popover-fade-in 0.18s ease-out both;
    transform-origin: bottom right;
}

@keyframes popover-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* -----------------------------------------------------------------------
   Product Badges & Tags
   ----------------------------------------------------------------------- */

.badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 2px;
}

.badge-new { 
    background: linear-gradient(135deg, #c5a059 0%, #b38e4a 100%); 
    color: white; 
}
.badge-sold-out { 
    background: linear-gradient(135deg, #404040 0%, #262626 100%); 
    color: white; 
}
.badge-discount { 
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%); 
    color: white; 
}

/* Sold Out State */
.is-sold-out {
    opacity: 0.6;
    filter: grayscale(1);
    pointer-events: auto; /* allow opening modal to see details */
}

/* Modal Status Badge */
.modal-status-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-right: 0.5rem;
    border-radius: 2px;
}

.product-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 2px 8px;
    background-color: #f5f5f5;
    color: #737373;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.product-tag:hover {
    background-color: #e5e5e5;
    color: #1a1919;
}

.layout-btn {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.layout-btn:active {
    transform: scale(0.92);
}

.layout-btn:hover:not([aria-pressed="true"]) {
    background-color: rgba(0, 0, 0, 0.03);
}

#product-grid.grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    row-gap: 2rem;
}

@media (min-width: 640px) {
    #product-grid.grid-compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    #product-grid.grid-compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    #product-grid.grid-compact {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Reduce image padding and font sizes slightly in compact mode */
#product-grid.grid-compact .product-card-img-wrapper {
    margin-bottom: 0.75rem;
}

#product-grid.grid-compact h3 {
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25rem;
}

#product-grid.grid-compact .btn-quickview {
    padding: 0.5rem 1rem;
    font-size: 10px;
}

/* Mobile Search Animation */
@keyframes animate-slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-slide-down {
    animation: animate-slide-down 0.3s ease-out forwards;
}

/* Compact Header when Searching */
.searching-active #product-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}
.searching-active #product-header > div:first-child {
    display: none;
}

/* Description & Share Styles */
.product-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.btn-share-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.btn-share-card:hover {
    background-color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.btn-share-card.is-copied {
    background-color: #f0fdf4 !important; /* bg-green-50 */
    border: 1px solid #bbf7d0; /* border-green-200 */
}

#product-grid.grid-compact .product-card-desc {
    display: none; /* Hide description in compact grid mode */
}
