/**
 * FAGY Excel Shop - Frontend Styles
 * Diseño inspirado en Apple con animaciones fluidas
 * @version 1.0.0
 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */

.fagy-excel-shop-wrapper * {
    box-sizing: border-box;
}

.fagy-excel-shop-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ============================================
   TOOLBAR & FILTERS
   ============================================ */

.fagy-shop-toolbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(10px);
}

.fagy-search-box {
    position: relative;
    margin-bottom: 20px;
}

.fagy-search-field {
    width: 100%;
    padding: 16px 56px 16px 20px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.fagy-search-field:focus {
    outline: none;
    border-color: #ff5a02;
    box-shadow: 0 0 0 4px rgba(255, 90, 2, 0.1);
    transform: translateY(-1px);
}

.fagy-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #ff5a02;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fagy-search-btn:hover {
    background: #ff7a32;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 90, 2, 0.3);
}

.fagy-search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.fagy-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.fagy-filter-select {
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    font-weight: 500;
    color: #1d1d1f;
}

.fagy-filter-select:hover {
    border-color: #ff5a02;
    transform: translateY(-1px);
}

.fagy-filter-select:focus {
    outline: none;
    border-color: #ff5a02;
    box-shadow: 0 0 0 4px rgba(255, 90, 2, 0.1);
}

/* ============================================
   RESULTS INFO
   ============================================ */

.fagy-shop-results-info {
    margin-bottom: 24px;
    padding: 12px 20px;
    background: rgba(255, 90, 2, 0.05);
    border-left: 4px solid #ff5a02;
    border-radius: 8px;
    font-weight: 600;
    color: #1d1d1f;
    font-size: 14px;
}

/* ============================================
   LOADING STATE
   ============================================ */

.fagy-shop-loading {
    text-align: center;
    padding: 80px 20px;
}

.fagy-loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 90, 2, 0.1);
    border-top-color: #ff5a02;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: fagy-spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

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

.fagy-shop-loading p {
    font-size: 16px;
    color: #6b7280;
    font-weight: 500;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */

.fagy-shop-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
    animation: fagy-fade-in 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fagy-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PRODUCT CARD - MODERN STYLE
   ============================================ */

.fagy-excel-product-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    display: flex;
    flex-direction: column;
}

.fagy-excel-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff5a02, #ff7a32);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fagy-excel-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.fagy-excel-product-card:hover::before {
    transform: scaleX(1);
}

/* Product Image */
.fagy-product-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow: hidden;
}

.fagy-product-image,
.fagy-product-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fagy-product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fagy-excel-product-card:hover .fagy-product-image {
    transform: scale(1.08);
}

.fagy-product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ff5a02;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: fagy-badge-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes fagy-badge-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Product Content */
.fagy-product-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fagy-product-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 8px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fagy-product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.fagy-product-title a:hover {
    color: #ff5a02;
}

.fagy-product-sku {
    font-size: 12px;
    color: #9ca3af;
    margin: 0 0 8px 0;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, monospace;
}

.fagy-product-category {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 6px;
    display: inline-block;
    align-self: flex-start;
}

/* Product Footer */
.fagy-product-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.fagy-product-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fagy-price-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.fagy-price-amount {
    font-size: 20px;
    font-weight: 800;
    color: #1d1d1f;
    letter-spacing: -0.02em;
}

.fagy-btn-quote {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #171717;
    color: #FFD800;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.fagy-btn-quote:hover {
    background: #FFD800;
    color: #171717;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 216, 0, 0.4);
}

.fagy-btn-quote:active {
    transform: translateY(0);
}

.fagy-btn-quote i {
    font-size: 16px;
}

/* ============================================
   NO RESULTS
   ============================================ */

.fagy-no-results {
    text-align: center;
    padding: 80px 20px;
    background: #f9fafb;
    border-radius: 16px;
    margin: 40px 0;
}

.fagy-no-results::before {
    content: '🔍';
    display: block;
    font-size: 64px;
    margin-bottom: 16px;
}

/* ============================================
   PAGINATION
   ============================================ */

.fagy-shop-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.fagy-pagination-btn {
    padding: 10px 16px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #1d1d1f;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fagy-pagination-btn:hover:not(:disabled) {
    background: #ff5a02;
    border-color: #ff5a02;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 90, 2, 0.3);
}

.fagy-pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.fagy-pagination-btn.active {
    background: #ff5a02;
    border-color: #ff5a02;
    color: white;
}

.fagy-pagination-info {
    padding: 0 16px;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .fagy-shop-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .fagy-excel-shop-wrapper {
        padding: 24px 16px;
    }

    .fagy-shop-toolbar {
        padding: 20px;
    }

    .fagy-filters {
        grid-template-columns: 1fr;
    }

    .fagy-shop-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .fagy-product-content {
        padding: 16px;
    }

    .fagy-product-title {
        font-size: 14px;
    }

    .fagy-price-amount {
        font-size: 18px;
    }

    .fagy-btn-quote {
        padding: 8px 12px;
        font-size: 11px;
    }

    .fagy-product-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .fagy-btn-quote {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .fagy-shop-products-grid {
        grid-template-columns: 1fr;
    }

    .fagy-pagination-info {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

.fagy-excel-product-card:focus-within {
    outline: 3px solid #ff5a02;
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .fagy-shop-toolbar,
    .fagy-shop-pagination,
    .fagy-btn-quote {
        display: none;
    }

    .fagy-excel-product-card {
        page-break-inside: avoid;
    }
}
