/**
 * Product Cards - Kartice proizvoda sa proširivim dodacima
 */

/* ==========================================
   PRODUCT CARD BASE
   ========================================== */
.product-card {
    background: var(--gradient-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-smooth);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 107, 53, 0.2);
}

/* ==========================================
   PRODUCT IMAGE
   ========================================== */
.product-card__image {
    position: relative;
    /* Fallback for Safari < 15 that doesn't support aspect-ratio */
    padding-bottom: 66.67%; /* 3:2 ratio fallback */
    height: 0;
    overflow: hidden;
}

@supports (aspect-ratio: 3/2) {
    .product-card__image {
        aspect-ratio: 3 / 2;
        padding-bottom: 0;
        height: auto;
    }
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: var(--bg-card);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-card__image img {
    transform: scale(1.08);
}

.product-card__image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(15, 15, 25, 0.9), transparent);
    pointer-events: none;
}

/* ==========================================
   BADGES
   ========================================== */
.product-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 2;
}

.product-card__badge {
    background: var(--primary-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.product-card__badge--new {
    background: linear-gradient(135deg, var(--success), #16a34a);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.product-card__badge--sale {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.product-card__badge--popular {
    background: linear-gradient(135deg, var(--accent-gold, #ffc107), #ff9800);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

/* ==========================================
   PRODUCT BODY
   ========================================== */
.product-card__body {
    padding: 20px;
}

.product-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.product-card__shop {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.product-card__category {
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.product-card__weight {
    background: rgba(255, 107, 53, 0.15);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.product-card__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

.product-card__name a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card__name a:hover {
    color: var(--primary);
}

.product-card__desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ==========================================
   PRODUCT FOOTER
   ========================================== */
.product-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.product-card__price {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-card__price-old {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 8px;
    font-weight: 400;
}

/* ==========================================
   ADDON SELECT BUTTON
   ========================================== */
.product-card__select-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gradient-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-card__select-btn:hover {
    border-color: var(--primary);
    background: var(--primary-gradient);
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
}

.product-card__select-btn i {
    transition: transform 0.3s ease;
}

.product-card.is-expanded .product-card__select-btn i {
    transform: rotate(180deg);
}

.product-card.is-expanded .product-card__select-btn {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

/* ==========================================
   ADDONS PANEL (Proširivi deo)
   ========================================== */
.product-card__addons {
    max-height: 0;
    overflow: hidden;
    background: rgba(10, 10, 15, 0.5);
    border-top: 0 solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card.is-expanded .product-card__addons {
    max-height: 600px;
    border-top-width: 1px;
}

.product-card__addons-inner {
    padding: 20px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease 0.1s;
}

.product-card.is-expanded .product-card__addons-inner {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   ADDON CATEGORIES
   ========================================== */
.addon-category {
    margin-bottom: 20px;
}

.addon-category:last-child {
    margin-bottom: 0;
}

.addon-category__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.addon-category__title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.addon-category__badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 107, 53, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.addon-category__badge--required {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* ==========================================
   ADDON ITEMS
   ========================================== */
.addon-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.addon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
}

.addon-item:hover {
    border-color: rgba(255, 107, 53, 0.3);
    background: rgba(255, 107, 53, 0.05);
}

.addon-item.is-selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(255, 107, 53, 0.08) 100%);
}

.addon-item__checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.addon-item.is-selected .addon-item__checkbox {
    background: var(--primary-gradient);
    border-color: transparent;
}

.addon-item.is-selected .addon-item__checkbox::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.addon-item__radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.addon-item.is-selected .addon-item__radio {
    border-color: var(--primary);
}

.addon-item.is-selected .addon-item__radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-gradient);
    border-radius: 50%;
}

.addon-item__name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.addon-item.is-selected .addon-item__name {
    color: var(--text-primary);
}

.addon-item__price {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    margin-left: auto;
}

/* ==========================================
   QUANTITY SELECTOR
   ========================================== */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-selector__btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-selector__btn:hover {
    background: var(--primary);
    color: white;
}

.quantity-selector__value {
    width: 50px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* ==========================================
   ADD TO CART SECTION
   ========================================== */
.product-card__cart-section {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.product-card__total {
    flex: 1;
}

.product-card__total-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.product-card__total-price {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-card__add-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.35);
}

.product-card__add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 53, 0.45);
}

.product-card__add-btn:active {
    transform: translateY(0);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .product-card__image {
        aspect-ratio: 3 / 2;
    }
    
    .product-card__body {
        padding: 16px;
    }
    
    .product-card__meta {
        margin-bottom: 8px;
    }
    
    .product-card__name {
        font-size: 1.05rem;
    }
    
    .product-card__price {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .product-card__image {
        aspect-ratio: 3 / 2;
    }
    
    .product-card__body {
        padding: 14px;
        overflow: hidden;
    }
    
    .product-card__meta {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .product-card__category {
        font-size: 0.75rem;
        padding-left: 0;
        border-left: none;
    }
    
    .product-card__weight {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
    
    .product-card__name {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
        word-break: break-word;
    }
    
    .product-card__description,
    .product-card__desc {
        font-size: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-card__price {
        font-size: 1rem;
    }
    
    .addon-items {
        gap: 6px;
    }
    
    .addon-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .product-card__cart-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .product-card__add-btn {
        width: 100%;
        justify-content: center;
    }
}
/* Landscape mode */
@media (orientation: landscape) and (max-height: 500px) {
    .product-card__image {
        aspect-ratio: 16 / 9;
    }
    
    .product-card__body {
        padding: 12px;
    }
    
    .product-card__name {
        font-size: 0.95rem;
        -webkit-line-clamp: 1;
    }
    
    .product-card__description {
        -webkit-line-clamp: 1;
        min-height: 0;
        margin-bottom: 8px;
    }
}

/* Small mobile */
@media (max-width: 375px) {
    .product-card__body {
        padding: 10px;
        overflow: hidden;
    }
    
    .product-card__name {
        font-size: 0.85rem;
        word-break: break-word;
        -webkit-line-clamp: 2;
    }
    
    .product-card__price {
        font-size: 0.95rem;
    }
    
    .product-card__desc,
    .product-card__description {
        font-size: 0.75rem;
    }
    
    .product-card__add {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================
   PRODUCT WITHOUT IMAGE - tekst umesto slike
   ========================================== */
.product-card--no-image {
    display: flex;
    flex-direction: column;
}

.product-card--no-image .product-card__text-top {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(255, 193, 7, 0.06));
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    aspect-ratio: 3 / 2;
    position: relative;
    overflow: hidden;
}

.product-card--no-image .product-card__text-top .product-card__name {
    font-size: 1.4rem;
    margin-bottom: 8px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    padding: 0 10px;
}

@media (max-width: 576px) {
    .product-card--no-image .product-card__text-top {
        padding: 20px 15px;
    }
    
    .product-card--no-image .product-card__text-top .product-card__name {
        font-size: 1rem;
        -webkit-line-clamp: 3;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

@media (max-width: 375px) {
    .product-card--no-image .product-card__text-top .product-card__name {
        font-size: 0.9rem;
    }
}

.product-card--no-image .product-card__text-top .product-card__weight {
    margin-top: 8px;
}

.product-card--no-image .product-card__text-top .product-card__badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* ==========================================
   TEXT-ONLY PRODUCT (drinks, etc)
   ========================================== */
.product-card--text-only {
    min-height: 0;
}

.product-card--text-only .product-card__image {
    display: none;
}

.product-card--text-only .product-card__body {
    padding: 24px;
}

.product-card--text-only .product-card__icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 193, 7, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
    font-size: 1.5rem;
}