/**
 * Ledech Kiosk - Product Detail Screen Styles
 * Full-page product customization with touch-friendly design
 */

/* ========== Container ========== */
.product-detail-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-card);
    overflow: hidden;
}

/* ========== Hero Section ========== */
.product-detail-hero {
    position: relative;
    width: 100%;
    height: 280px;
    flex-shrink: 0;
    overflow: hidden;
}

.product-detail-hero-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
}

.product-detail-hero-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.product-detail-hero-placeholder .material-symbols-outlined {
    font-size: 5rem;
    color: #94a3b8;
}

.product-detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
}

.product-detail-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    z-index: 10;
}

.product-detail-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.product-detail-base-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00ccff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Back Button - Glass Panel Style in Footer */
.product-detail-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 2rem;
    transition: all 0.15s ease;
    min-width: 130px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.product-detail-back-btn:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.05);
}

.product-detail-back-btn .material-symbols-outlined {
    font-size: 1.25rem;
    color: #64748b;
}

.product-detail-back-btn span:not(.material-symbols-outlined) {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== Product Description ========== */
.product-detail-description {
    padding: 1rem 1.25rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #64748b;
}

/* ========== Calorie / Allergen Info ========== */
.product-detail-info-row {
    padding: 0.5rem 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.product-detail-info-item {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #64748b;
}

.product-detail-info-item strong {
    color: #334155;
    font-weight: 600;
}

/* ========== Body Section (Scrollable) ========== */
.product-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 160px;
    /* Space for footer */
}

.product-detail-no-addons {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    font-size: 1rem;
}

/* ========== Addon Group ========== */
.product-detail-group {
    margin-bottom: 1.5rem;
}

.product-detail-group:last-child {
    margin-bottom: 0;
}

.product-detail-group.required-error .product-detail-group-header {
    border: 2px solid #ef4444;
    animation: shake 0.5s ease;
}

.product-detail-validation-error {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0.4rem 0 0;
    padding: 0 0.25rem;
}

.product-detail-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.product-detail-group-icon {
    font-size: 1.5rem;
}

.product-detail-group-icon.ingredient {
    color: #f97316;
}

.product-detail-group-icon.extra {
    color: #22c55e;
}

.product-detail-group-title {
    flex: 1;
}

.product-detail-group-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.product-detail-group-type {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-detail-required {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

/* ========== Sub-Addon Groups (Eklentiye Eklenti / Nested Addon, 1 seviye) ========== */
.product-detail-subgroup {
    margin-top: 0.75rem;
    margin-left: 1rem;
    padding: 0.75rem;
    background: rgba(34, 197, 94, 0.05);
    border: 1px dashed rgba(34, 197, 94, 0.35);
    border-radius: 0.75rem;
}

.product-detail-subgroup-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.product-detail-subgroup-header .material-symbols-outlined {
    font-size: 1.1rem;
    color: #22c55e;
}

/* ========== Addon Cards ========== */
.product-detail-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.75rem;
}

.product-detail-card {
    background: white;
    border-radius: 1rem;
    padding: 1.25rem;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 3px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
}

.product-detail-card:active {
    transform: scale(0.97);
}

/* Included state (default ingredients) */
.product-detail-card.included {
    border-color: #22c55e;
    background: #f0fdf4;
}

/* Removed state */
.product-detail-card.removed {
    border-color: #ef4444;
    background: #fef2f2;
    opacity: 0.8;
}

.product-detail-card.removed .product-detail-card-name {
    text-decoration: line-through;
    color: #94a3b8;
}

/* Added state (extras) */
.product-detail-card.added {
    border-color: #22c55e;
    background: #f0fdf4;
}

/* Card Content */
.product-detail-card-content {
    flex: 1;
    padding-right: 3rem;
    /* Space for action button */
    display: flex;
    flex-direction: column;
}

.product-detail-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    word-break: break-word;
}

.product-detail-card-price {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0055ff;
    margin-top: auto;
    padding-top: 0.5rem;
}

.product-detail-card-included {
    display: block;
    font-size: 0.7rem;
    color: #22c55e;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.product-detail-card-removed-badge {
    display: block;
    font-size: 0.7rem;
    color: #ef4444;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Card Action Button */
.product-detail-card-action {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    transition: all 0.15s ease;
}

.product-detail-card-action .material-symbols-outlined {
    font-size: 1.3rem;
    color: #64748b;
}

.product-detail-card-action.selected,
.product-detail-card-action.add-back {
    background: #22c55e;
}

.product-detail-card-action.selected .material-symbols-outlined,
.product-detail-card-action.add-back .material-symbols-outlined {
    color: white;
}

.product-detail-card-action.remove {
    background: #fecaca;
}

.product-detail-card-action.remove .material-symbols-outlined {
    color: #ef4444;
}

/* ========== Fixed Footer ========== */
.product-detail-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    gap: 1rem;
    z-index: 100;
}

.product-detail-footer-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-detail-total {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    text-align: right;
}

.product-detail-total-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.product-detail-total-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
}

.product-detail-add-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #0055ff 0%, #00ccff 100%);
    color: white;
    padding: 1.25rem 2rem;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.15s ease;
    box-shadow: 0 4px 15px rgba(0, 85, 255, 0.35);
}

.product-detail-add-btn:active {
    transform: scale(0.95);
}

.product-detail-add-btn .material-symbols-outlined {
    font-size: 1.5rem;
}

/* ========== Responsive ========== */
@media screen and (min-width: 768px) {
    .product-detail-hero {
        height: 320px;
    }

    .product-detail-title {
        font-size: 2.5rem;
    }

    .product-detail-items {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }

    .product-detail-card {
        min-height: 120px;
    }
}

@media screen and (min-width: 1200px) {
    .product-detail-hero {
        height: 360px;
    }

    .product-detail-items {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    }
}