/* Mobile UX Styles - Comfy Languages */

/* Touch Target Improvements */
.comfy-touch-optimized a,
.comfy-touch-optimized button,
.comfy-touch-optimized input[type="submit"],
.comfy-touch-optimized .button {
    min-height: 44px;
    min-width: 44px;
}

/* Sticky Add to Cart */
.comfy-sticky-add-to-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

.comfy-sticky-add-to-cart.visible {
    transform: translateY(0);
}

/* Prevent sticky bar from covering footer content */
.comfy-sticky-add-to-cart.visible ~ footer,
body:has(.comfy-sticky-add-to-cart.visible) .site-footer,
body:has(.comfy-sticky-add-to-cart.visible) footer {
    padding-bottom: 80px;
}

.comfy-sticky-add-to-cart-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.comfy-sticky-product-info {
    flex: 1;
    min-width: 0;
}

.comfy-sticky-product-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.comfy-sticky-product-price {
    font-size: 16px;
    font-weight: bold;
    color: #10b981;
}

.comfy-sticky-add-to-cart-btn {
    background: #0000ac;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.3s ease;
}

.comfy-sticky-add-to-cart-btn:hover {
    background: #000088;
}

/* Bottom Sheet Base */
.comfy-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.comfy-bottom-sheet.active {
    transform: translateY(0);
}

.comfy-bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 12px auto 8px;
    cursor: grab;
}

.comfy-bottom-sheet-header {
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.comfy-bottom-sheet-title {
    font-size: 18px;
    font-weight: 600;
    color: #0000ac;
}

.comfy-bottom-sheet-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.comfy-bottom-sheet-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.comfy-bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.comfy-bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Cart Bottom Sheet */
.comfy-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.comfy-cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.comfy-cart-item-info {
    flex: 1;
    min-width: 0;
}

.comfy-cart-item-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.comfy-cart-item-price {
    font-weight: bold;
    color: #10b981;
}

.comfy-cart-summary {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.comfy-cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.comfy-cart-actions {
    display: flex;
    gap: 10px;
}

.comfy-cart-actions .button {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
}

/* Filters Bottom Sheet */
.comfy-filter-group {
    margin-bottom: 20px;
}

.comfy-filter-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    display: block;
}

.comfy-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comfy-filter-option {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.comfy-filter-option.active {
    background: #0000ac;
    color: white;
    border-color: #0000ac;
}

.comfy-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.comfy-filter-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.comfy-filter-apply {
    background: #0000ac;
    color: white;
}

.comfy-filter-clear {
    background: #f3f4f6;
    color: #6b7280;
}

/* Mobile Menu */
.comfy-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 350px;
    background: white;
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
}

.comfy-mobile-menu.active {
    transform: translateX(0);
}

.comfy-mobile-menu-header {
    padding: 20px;
    background: linear-gradient(135deg, #0000ac 0%, #6ee4d0 100%);
    color: white;
}

.comfy-mobile-menu-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    float: right;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.comfy-mobile-menu-title {
    font-size: 20px;
    font-weight: bold;
    margin-top: 10px;
}

.comfy-mobile-menu-nav {
    padding: 20px 0;
}

.comfy-mobile-menu-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #374151;
    text-decoration: none;
    transition: background 0.3s ease;
    border-bottom: 1px solid #f3f4f6;
}

.comfy-mobile-menu-item:hover {
    background: #f9fafb;
}

.comfy-mobile-menu-text {
    flex: 1;
    font-weight: 500;
}

.comfy-mobile-menu-arrow {
    color: #9ca3af;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #0000ac;
}

.mobile-menu-toggle:hover {
    opacity: 0.7;
}

/* Swipe Indicators */
.comfy-carousel-container {
    position: relative;
    overflow: hidden;
}

.comfy-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.comfy-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    transition: all 0.3s ease;
}

.comfy-carousel-dot.active {
    background: #0000ac;
    width: 24px;
    border-radius: 4px;
}

/* Pull to Refresh */
.comfy-pull-to-refresh {
    position: relative;
}

.comfy-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: top 0.3s ease;
}

.comfy-refresh-indicator.visible {
    top: 20px;
}

.comfy-refresh-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #0000ac;
    border-radius: 50%;
    animation: comfy-spin 1s linear infinite;
}

@keyframes comfy-spin {
    to { transform: rotate(360deg); }
}

/* Float Actions */
.comfy-float-actions {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 998;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comfy-float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #0000ac;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    position: relative;
}

.comfy-float-btn:hover {
    transform: scale(1.1);
}

.comfy-float-btn.cart-btn {
    background: #10b981;
}

.comfy-float-btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Hide mobile-only features on desktop */
@media (min-width: 769px) {
    .comfy-sticky-add-to-cart,
    .comfy-mobile-menu {
        display: none !important;
    }
    /* Hide cart float button on desktop (header cart suffices) */
    .comfy-float-btn.cart-btn {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .comfy-sticky-add-to-cart,
    .comfy-mobile-menu {
        display: block;
    }
}

/* Sticky CTA Button */
.comfy-sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    text-align: center;
}

.comfy-sticky-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg, #0000ac 0%, #9999ff 100%);
    color: white !important;
    text-decoration: none !important;
    padding: 14px 48px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.comfy-sticky-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,172,0.3);
}

/* Sticky CTA — sale/discount modifiers */
.comfy-sticky-cta-btn .comfy-sticky-cta-label {
    font-weight: 700;
}

.comfy-sticky-cta-btn .comfy-sticky-cta-price {
    font-weight: 700;
    margin-left: 4px;
}

.comfy-sticky-cta-btn .comfy-sticky-cta-original {
    margin-left: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0.75;
}

.comfy-sticky-cta-btn .comfy-sticky-cta-original del {
    text-decoration: line-through;
}

.comfy-sticky-cta-btn .comfy-sticky-cta-discount {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    background: #10b981;
    color: #ffffff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

@media (max-width: 480px) {
    .comfy-sticky-cta-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .comfy-sticky-cta-btn .comfy-sticky-cta-original,
    .comfy-sticky-cta-btn .comfy-sticky-cta-discount {
        font-size: 0.75rem;
    }
}
