/* Modern Item Cards - Estilos avançados para cards de produtos */

:root {
    --primary-red: #FF1853;
    --secondary-gray: #5B6876;
    --dark-gray: #3A3A3A;
    --light-blue: #EBF6FF;
    --white: #FFFFFF;
    --light-gray: #EFF1F3;
    --card-radius: 16px;
    --transition: all 0.3s ease;
    --glass-background: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(10px);
    --flip-duration: 0.8s;
}

/* Card principal */
.item {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    perspective: 1000px;
}

/* Flip Card Container */
.item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform var(--flip-duration);
    transform-style: preserve-3d;
}

/* Ativa o efeito flip */
.item.flip-active .item-inner {
    transform: rotateY(180deg);
}

/* Frente e verso do card */
.item-front {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: rotateY(0deg);
}

.item-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    background: linear-gradient(135deg, rgba(255, 24, 83, 0.9), rgba(91, 104, 118, 0.9));
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: var(--card-radius);
}

/* Conteúdo do verso do card */
.item-back-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    max-width: 90%;
    margin: 0 auto;
    height: 100%;
    justify-content: center;
}

.item-back-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.3;
    text-align: center;
}

.item-back-description {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
    margin: 0;
    text-align: center;
}

/* Botões de ação no verso do card */
.item-back-actions {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    margin-top: auto;
    width: 100%;
    justify-content: space-between;
}

.item-back-actions .btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.item-back-actions .flex-grow-1 {
    flex: 2;
}

.item-back-actions form {
    flex: 2;
    display: flex;
}

.item-back-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.item-back-actions .btn-primary {
    background: linear-gradient(135deg, #FF1853, #e91e63);
    border-color: rgba(255, 255, 255, 0.3);
}

.item-back-actions .btn-primary:hover {
    background: linear-gradient(135deg, #e91e63, #FF1853);
    box-shadow: 0 8px 20px rgba(255, 24, 83, 0.4);
}

.item-back-actions .btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: rgba(255, 255, 255, 0.3);
}

.item-back-actions .btn-success:hover {
    background: linear-gradient(135deg, #20c997, #28a745);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.item-back-actions .btn-outline-light {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.item-back-actions .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

/* Animação dos ícones nos botões do verso */
.item-back-actions .btn i {
    transition: transform 0.3s ease;
}

.item-back-actions .btn:hover i {
    transform: scale(1.1);
}

/* Responsividade para botões do verso */
@media (max-width: 480px) {
    .item-back-actions {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .item-back-actions .btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        flex: 1;
    }
    
    .item-back-actions .flex-grow-1,
    .item-back-actions form {
        flex: 1;
    }
}

@media (min-width: 481px) {
    .item-back-actions {
        flex-direction: row !important;
    }
}

.item-back-stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin: 1rem 0;
}

.item-back-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.item-back-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.item-back-stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.item-back .btn {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.item-back .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* Indicador de flip */
.flip-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: scale(0.8);
    pointer-events: none;
}

.item:hover .flip-indicator {
    opacity: 1;
    transform: scale(1);
}

/* Círculo de progresso SVG */
.flip-progress {
    width: 36px;
    height: 36px;
    transform: rotate(-90deg);
    position: absolute;
    top: 0;
    left: 0;
}

.flip-progress-circle {
    fill: none;
    stroke: var(--primary-red);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s;
}

/* Ícone dentro do indicador */
.flip-indicator i {
    font-size: 14px;
    color: white;
    z-index: 2;
    opacity: 0.9;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

.item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(235, 246, 255, 0.05) 0%, rgba(255, 255, 255, 0) 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.item:hover {
    transform: translateY(-8px) perspective(1000px) rotateX(2deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 24, 83, 0.3);
}

.item:hover::before {
    opacity: 1;
}

/* Header do card */
.item-header {
    position: relative;
    overflow: hidden;
}

.item-img {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--light-gray);
}

.item-img img {
    width: 100%;
    height: auto;
    transition: transform 0.7s ease;
    object-fit: cover;
}

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

.item-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 70%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.item:hover .item-img::after {
    opacity: 1;
}

/* Badges */
.item-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 3;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.item-badge i {
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.item:hover .item-badge i {
    transform: scale(1.2);
    animation: pulse-icon 1s infinite alternate;
}

@keyframes pulse-icon {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

.item:hover .item-badge {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.item-badge-premium {
    background: linear-gradient(135deg, #FF1853 0%, #ff4d7a 100%);
    color: white;
}

.item-badge-free {
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
}

.item-badge-sale {
    background: linear-gradient(135deg, #FF9800 0%, #FFC107 100%);
    color: white;
}

.item-badge-trending {
    background: linear-gradient(135deg, #2196F3 0%, #03A9F4 100%);
    color: white;
}

/* Conteúdo do card */
.item-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Título do item */
.item-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    line-height: 1.4;
    position: relative;
    transition: all 0.3s ease;
}

.item-title a {
    color: var(--dark-gray);
    text-decoration: none;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
    background: linear-gradient(to right, var(--dark-gray), var(--dark-gray));
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    padding-bottom: 2px;
}

.item:hover .item-title a {
    color: var(--primary-red);
    background-image: linear-gradient(to right, var(--primary-red), var(--primary-red));
    background-size: 100% 1px;
}

.item-title a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: width 0.3s ease;
}

.item:hover .item-title a::after {
    width: 40px;
}

/* Categorias */
.item-category .breadcrumb {
    padding: 0;
    background: transparent;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.item-category .breadcrumb-item a {
    color: var(--secondary-gray);
    transition: color 0.3s ease;
}

.item-category .breadcrumb-item a:hover {
    color: var(--primary-red);
}

/* Preços */
.item-price-area {
    margin-top: auto;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.item:hover .item-price-area {
    transform: translateY(-3px);
}

.item-price {
    display: flex;
    align-items: center;
    font-weight: 700;
}

.item-price-through {
    text-decoration: line-through;
    color: var(--secondary-gray);
    font-size: 0.9rem;
    margin-right: 0.5rem;
    opacity: 0.7;
}

.item-price-amount {
    color: var(--primary-red);
    font-size: 1.25rem;
    position: relative;
}

.item-price-amount::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255, 24, 83, 0.3);
    transition: width 0.3s ease;
}

.item:hover .item-price-amount::after {
    width: 100%;
}

/* Botões */
.item .btn {
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.item .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.1) 100%);
    transition: all 0.4s ease;
    z-index: 0;
}

.item .btn:hover::before {
    left: 100%;
}

.item .btn-primary {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.item .btn-primary:hover {
    background: #e6164a;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 20px rgba(230, 22, 74, 0.3);
}

.item .btn-primary::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--primary-red);
    border-radius: 16px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease;
    z-index: -1;
}

.item .btn-primary:hover::after {
    opacity: 0.3;
    transform: scale(1);
}

.item .btn-outline-secondary {
    border-color: var(--light-gray);
    color: var(--secondary-gray);
}

.item .btn-outline-secondary:hover {
    background: var(--light-gray);
    color: var(--dark-gray);
    transform: translateY(-3px) scale(1.03);
}

.item .btn i {
    position: relative;
    z-index: 1;
}

/* Estatísticas */
.item-sales {
    transition: all 0.3s ease;
}

.item:hover .item-sales {
    color: var(--primary-red) !important;
}

/* Animações */
@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255, 24, 83, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 24, 83, 0.5); }
    100% { box-shadow: 0 0 5px rgba(255, 24, 83, 0.3); }
}

/* Decorative elements */
.item::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 24, 83, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -30px;
    right: -30px;
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 0;
}

.item:hover::after {
    opacity: 1;
    transform: scale(1.5);
}

/* Responsividade */
@media (max-width: 991px) {
    .item-title {
        font-size: 1.1rem;
    }
    
    .item-price-amount {
        font-size: 1.1rem;
    }
}

@media (max-width: 767px) {
    .item {
        margin-bottom: 1.5rem;
    }
}
