/**
 * MEATIOWA Premium Marketplace Styles
 * "Digital Artisan" Aesthetic - Luxury, Trust, Texture
 */

/* ============================================
   Design Tokens - Earthy Palette
   ============================================ */
:root {
    /* Core Colors */
    --color-barn-red: #8B2635;
    --color-barn-red-dark: #6B1D29;
    --color-cream: #F5F0E8;
    --color-cream-light: #FFFDF8;
    --color-slate: #3D4F5F;
    --color-sage: #7C9082;
    --color-sage-light: #A8BFA8;

    /* Trust Colors */
    --color-gold: #C4A35A;
    --color-gold-light: #E8D5A8;
    --color-usda-green: #2E7D32;
    --color-organic-green: #558B2F;

    /* Typography */
    --font-display: 'Bitter', Georgia, serif;
    --font-body: 'Source Sans Pro', system-ui, sans-serif;
    --font-handwritten: 'Caveat', cursive;

    /* Shadows - Soft, Editorial */
    --shadow-subtle: 0 2px 8px rgba(61, 79, 95, 0.08);
    --shadow-card: 0 4px 16px rgba(61, 79, 95, 0.12);
    --shadow-elevated: 0 8px 32px rgba(61, 79, 95, 0.16);
    --shadow-modal: 0 16px 48px rgba(61, 79, 95, 0.24);

    /* Borders */
    --border-subtle: 1px solid rgba(61, 79, 95, 0.1);
    --border-defined: 1px solid rgba(61, 79, 95, 0.2);

    /* Animation */
    --transition-fast: 150ms ease;
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   Producer Profile Component
   ============================================ */
.producer-profile {
    background: var(--color-cream-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: var(--border-subtle);
}

.producer-header {
    position: relative;
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-barn-red) 0%, var(--color-barn-red-dark) 100%);
    color: white;
}

.producer-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.producer-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.producer-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--color-barn-red);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.producer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.producer-info h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.producer-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.producer-tagline {
    font-family: var(--font-handwritten);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    opacity: 0.85;
}

.producer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: var(--border-subtle);
}

.producer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.producer-badge.usda {
    background: var(--color-usda-green);
    color: white;
}

.producer-badge.organic {
    background: var(--color-organic-green);
    color: white;
}

.producer-badge.local {
    background: var(--color-gold);
    color: var(--color-slate);
}

.producer-badge.family {
    background: var(--color-barn-red);
    color: white;
}

.producer-story {
    padding: 1.5rem 2rem;
}

.producer-story h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-slate);
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.producer-story p {
    font-family: var(--font-body);
    color: #555;
    line-height: 1.7;
    margin: 0;
}

.producer-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border-subtle);
    border-top: var(--border-subtle);
}

.producer-stat {
    padding: 1.25rem;
    text-align: center;
    background: var(--color-cream-light);
}

.producer-stat-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-barn-red);
}

.producer-stat-label {
    font-size: 0.75rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.producer-traceability {
    padding: 1.5rem 2rem;
    background: var(--color-sage-light);
    background: linear-gradient(to right, rgba(124, 144, 130, 0.1), rgba(124, 144, 130, 0.05));
}

.producer-traceability h4 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--color-slate);
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.traceability-chain {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.traceability-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--color-slate);
    box-shadow: var(--shadow-subtle);
}

.traceability-step i {
    color: var(--color-sage);
}

.traceability-arrow {
    color: var(--color-sage);
    font-size: 0.75rem;
}

/* ============================================
   Premium Product Card
   ============================================ */
.product-card-premium {
    background: var(--color-cream-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: var(--border-subtle);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.product-card-premium:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
}

.product-card-premium:active {
    transform: translateY(-2px);
}

.product-card-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    background: #f0ebe3;
    overflow: hidden;
}

.product-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.product-card-premium:hover .product-card-image-wrapper img {
    transform: scale(1.05);
}

.product-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--color-barn-red);
    opacity: 0.3;
}

/* Skeleton Loading */
.product-card-skeleton .product-card-image-wrapper {
    background: linear-gradient(
        90deg,
        #f0ebe3 25%,
        #e8e3db 50%,
        #f0ebe3 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.product-card-badges-row {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.product-badge-featured {
    background: var(--color-gold);
    color: var(--color-slate);
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-badge-stock {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.product-badge-stock.low {
    background: rgba(255, 152, 0, 0.9);
    color: white;
}

.product-badge-stock.last {
    background: var(--color-barn-red);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.product-card-body {
    padding: 1rem;
}

.product-card-producer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.product-card-producer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-barn-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
}

.product-card-producer-name {
    font-size: 0.75rem;
    color: #888;
    font-weight: 500;
}

.product-card-category-tag {
    font-family: var(--font-handwritten);
    color: var(--color-sage);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.product-card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-slate);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.product-card-weight-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.75rem;
}

.product-card-weight-info i {
    color: var(--color-sage);
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.product-card-price-block {
    display: flex;
    flex-direction: column;
}

.product-card-price {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-barn-red);
}

.product-card-unit {
    font-size: 0.75rem;
    color: #888;
}

.product-card-add-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--color-barn-red);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px rgba(139, 38, 53, 0.3);
}

.product-card-add-btn:hover {
    background: var(--color-barn-red-dark);
    transform: scale(1.1);
}

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

/* Add to cart animation */
.product-card-add-btn.added {
    animation: add-bounce 0.4s ease;
    background: var(--color-sage);
}

@keyframes add-bounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* ============================================
   Premium Product Detail Modal
   ============================================ */
.product-detail-premium {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (max-width: 768px) {
    .product-detail-premium {
        grid-template-columns: 1fr;
    }
}

.product-detail-gallery {
    position: relative;
    background: var(--color-cream);
    min-height: 400px;
}

.product-detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    color: var(--color-barn-red);
    opacity: 0.2;
}

.product-detail-badges {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.product-detail-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.product-detail-producer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-cream);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

.product-detail-producer-link:hover {
    background: var(--color-cream);
    box-shadow: var(--shadow-subtle);
}

.product-detail-producer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-barn-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.product-detail-producer-info {
    flex: 1;
}

.product-detail-producer-name {
    font-weight: 600;
    color: var(--color-slate);
    font-size: 0.9rem;
}

.product-detail-producer-location {
    font-size: 0.8rem;
    color: #888;
}

.product-detail-category {
    font-family: var(--font-handwritten);
    font-size: 1.25rem;
    color: var(--color-sage);
    margin-bottom: 0.25rem;
}

.product-detail-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-slate);
    margin: 0 0 1rem;
    line-height: 1.3;
}

.product-detail-description {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 1.5rem;
}

.product-detail-pricing {
    padding: 1.25rem;
    background: var(--color-cream);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.product-detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.product-detail-price {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-barn-red);
}

.product-detail-unit {
    font-size: 1rem;
    color: #888;
}

.product-detail-estimate {
    font-size: 0.9rem;
    color: var(--color-slate);
}

.product-detail-estimate-note {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

/* Weight Selector */
.weight-selector-premium {
    margin-bottom: 1.5rem;
}

.weight-selector-label {
    display: block;
    font-weight: 600;
    color: var(--color-slate);
    margin-bottom: 0.75rem;
}

.weight-presets {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.weight-preset-btn {
    padding: 0.625rem 1rem;
    border: 2px solid var(--color-cream);
    background: var(--color-cream-light);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-slate);
    cursor: pointer;
    transition: var(--transition-fast);
}

.weight-preset-btn:hover {
    border-color: var(--color-barn-red);
    background: white;
}

.weight-preset-btn.active {
    border-color: var(--color-barn-red);
    background: var(--color-barn-red);
    color: white;
}

.weight-custom-input {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.weight-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--color-cream);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.weight-input-wrapper:focus-within {
    border-color: var(--color-barn-red);
    background: white;
}

.weight-input-wrapper input {
    width: 80px;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--color-slate);
}

.weight-input-wrapper input:focus {
    outline: none;
}

.weight-input-unit {
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.05);
    font-weight: 600;
    color: #888;
}

/* Cut Selection */
.cut-selector-premium {
    margin-bottom: 1.5rem;
}

.cut-selector-label {
    display: block;
    font-weight: 600;
    color: var(--color-slate);
    margin-bottom: 0.75rem;
}

.cut-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.cut-option {
    padding: 0.75rem 1rem;
    border: 2px solid var(--color-cream);
    background: var(--color-cream-light);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.cut-option:hover {
    border-color: var(--color-barn-red);
}

.cut-option.selected {
    border-color: var(--color-barn-red);
    background: rgba(139, 38, 53, 0.05);
}

.cut-option-name {
    font-weight: 600;
    color: var(--color-slate);
    font-size: 0.9rem;
}

.cut-option-price {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

/* Add to Cart Button */
.add-to-cart-btn-premium {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    background: var(--color-barn-red);
    color: white;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(139, 38, 53, 0.3);
    margin-top: auto;
}

.add-to-cart-btn-premium:hover {
    background: var(--color-barn-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 38, 53, 0.4);
}

.add-to-cart-btn-premium:active {
    transform: translateY(0);
}

.add-to-cart-btn-premium:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Stock Status */
.stock-status-premium {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.stock-status-premium.in-stock {
    background: rgba(46, 125, 50, 0.1);
    color: var(--color-usda-green);
}

.stock-status-premium.low-stock {
    background: rgba(255, 152, 0, 0.1);
    color: #e65100;
}

.stock-status-premium.last-item {
    background: rgba(139, 38, 53, 0.1);
    color: var(--color-barn-red);
    animation: pulse 2s infinite;
}

.stock-status-premium.out-of-stock {
    background: rgba(0, 0, 0, 0.05);
    color: #888;
}

/* ============================================
   Trust Badges Section
   ============================================ */
.trust-badges-premium {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: var(--border-subtle);
    margin-top: 1rem;
}

.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #666;
}

.trust-badge-item i {
    color: var(--color-sage);
}

/* ============================================
   Checkout Premium Styles
   ============================================ */
.checkout-premium {
    max-width: 800px;
    margin: 0 auto;
}

.checkout-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--color-cream);
    border-radius: 12px;
}

.checkout-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    color: #888;
}

.checkout-step.active {
    color: var(--color-barn-red);
    font-weight: 600;
}

.checkout-step.completed {
    color: var(--color-sage);
}

.checkout-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ddd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.checkout-step.active .checkout-step-number {
    background: var(--color-barn-red);
}

.checkout-step.completed .checkout-step-number {
    background: var(--color-sage);
}

.checkout-step-divider {
    width: 40px;
    height: 2px;
    background: #ddd;
}

.checkout-step.completed + .checkout-step-divider {
    background: var(--color-sage);
}

.checkout-section-premium {
    background: var(--color-cream-light);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-subtle);
    border: var(--border-subtle);
}

.checkout-section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-slate);
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkout-section-title i {
    color: var(--color-barn-red);
}

/* Variable Weight Notice */
.variable-weight-notice {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(196, 163, 90, 0.1);
    border: 1px solid var(--color-gold);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.variable-weight-notice-icon {
    font-size: 1.25rem;
    color: var(--color-gold);
    flex-shrink: 0;
}

.variable-weight-notice-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-slate);
    margin: 0 0 0.25rem;
}

.variable-weight-notice-content p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* Order Summary Premium */
.order-summary-premium {
    background: var(--color-cream);
    border-radius: 16px;
    padding: 1.5rem;
}

.order-summary-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: var(--border-subtle);
}

.order-summary-item:last-child {
    border-bottom: none;
}

.order-summary-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-summary-item-image i {
    font-size: 1.5rem;
    color: var(--color-barn-red);
    opacity: 0.5;
}

.order-summary-item-info {
    flex: 1;
}

.order-summary-item-name {
    font-weight: 600;
    color: var(--color-slate);
    margin-bottom: 0.25rem;
}

.order-summary-item-meta {
    font-size: 0.85rem;
    color: #888;
}

.order-summary-item-price {
    font-weight: 600;
    color: var(--color-barn-red);
    text-align: right;
}

.order-summary-item-estimate {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.order-summary-totals {
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

.order-summary-row.total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-slate);
    padding-top: 0.75rem;
    border-top: var(--border-subtle);
    margin-top: 0.5rem;
}

.order-summary-row .stewardship {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-sage);
}

.order-summary-row .stewardship i {
    font-size: 0.8rem;
}
