/**
 * Shop — Panier, checkout, items
 * Dépend de : config/gas-design-tokens.css
 */

/* ==========================================================================
   CONTENEUR PANIER
   ========================================================================== */

.gas-shop-panier-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--gas-space-l);
}

.gas-shop-panier-vide {
    text-align: center;
    padding: 60px var(--gas-space-l);
    background: var(--gas-bg-surface-alt);
    border-radius: var(--gas-radius-m);
}

/* ==========================================================================
   MESSAGES DE FUSION / INFO GLOBALE
   ========================================================================== */

.gas-shop-merge-messages {
    background: var(--gas-warning-light);
    border: 1px solid var(--gas-warning);
    border-radius: var(--gas-radius-m);
    padding: var(--gas-space-m);
    margin-bottom: var(--gas-space-l);
}

.gas-shop-message-warning {
    background: var(--gas-warning-light);
    color: var(--gas-warning-text);
    border-left: 4px solid var(--gas-warning);
    padding: var(--gas-space-s) var(--gas-space-m);
    border-radius: var(--gas-radius-s);
    margin-bottom: var(--gas-space-s);
    font-size: var(--gas-text-s);
    line-height: var(--gas-leading-normal);
}

.gas-shop-message-info {
    background: var(--gas-info-light);
    color: var(--gas-info-text);
    border-left: 4px solid var(--gas-info);
    padding: var(--gas-space-s) var(--gas-space-m);
    border-radius: var(--gas-radius-s);
    margin-bottom: var(--gas-space-s);
    font-size: var(--gas-text-s);
    line-height: var(--gas-leading-normal);
}

.gas-shop-message-success {
    background: var(--gas-success-light);
    color: var(--gas-success-text);
    border-left: 4px solid var(--gas-success);
    padding: var(--gas-space-s) var(--gas-space-m);
    border-radius: var(--gas-radius-s);
    margin-bottom: var(--gas-space-s);
    font-size: var(--gas-text-s);
    line-height: var(--gas-leading-normal);
}

.gas-shop-global-info-message {
    display: flex;
    align-items: center;
    gap: var(--gas-space-m);
    background: var(--gas-info-light);
    border: 1px solid var(--gas-info);
    border-radius: var(--gas-radius-m);
    padding: var(--gas-space-m) var(--gas-space-l);
    margin-bottom: var(--gas-space-l);
}

.gas-info-icon {
    font-size: var(--gas-text-2xl);
    flex-shrink: 0;
}

.gas-info-text {
    flex: 1;
    color: var(--gas-info-text);
    font-size: var(--gas-text-s);
    line-height: var(--gas-leading-normal);
}

.gas-shop-cart-cleanup-message {
    background: var(--gas-warning-light);
    color: var(--gas-warning-text);
    border: 1px solid var(--gas-warning);
    padding: var(--gas-space-m);
    border-radius: var(--gas-radius-s);
    margin-bottom: var(--gas-space-l);
}

.gas-shop-cart-cleanup-message ul {
    margin: var(--gas-space-s) 0 0 var(--gas-space-l);
    padding: 0;
}

.gas-shop-cart-cleanup-message li {
    margin-bottom: var(--gas-space-xs);
    color: var(--gas-warning-text);
}

/* ==========================================================================
   LAYOUT PANIER
   ========================================================================== */

.gas-shop-panier-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gas-space-xl);
    margin-top: var(--gas-space-l);
}

.gas-shop-panier-items {
    background: var(--gas-white);
    border-radius: var(--gas-radius-m);
    overflow: hidden;
    border: 1px solid var(--gas-border-color);
}

/* ==========================================================================
   ITEMS DU PANIER
   ========================================================================== */

.gas-shop-panier-item {
    display: flex;
    flex-direction: column;
    gap: var(--gas-space-m);
    padding: var(--gas-space-l);
    border-bottom: 1px solid var(--gas-border-color);
    position: relative;
}

.gas-shop-panier-item:last-child {
    border-bottom: none;
}

.gas-shop-item-header {
    display: flex;
    gap: var(--gas-space-m);
    align-items: flex-start;
    width: 100%;
}

.gas-shop-item-image img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--gas-radius-m);
}

.gas-shop-item-main-info {
    flex: 1;
    min-width: 0;
}

.gas-shop-item-title {
    margin: 0 0 var(--gas-space-s) 0;
    font-size: var(--gas-text-l);
    font-weight: var(--gas-weight-semi);
    color: var(--gas-text-color);
}

.gas-shop-item-variant-full {
    display: flex;
    align-items: center;
    gap: var(--gas-space-s);
    padding: var(--gas-space-m);
    background: var(--gas-bg-surface-alt);
    border-radius: var(--gas-radius-s);
    font-size: var(--gas-text-s);
    color: var(--gas-neutral-700);
    width: 100%;
}

.gas-shop-variant-description {
    color: var(--gas-text-color-light);
    font-style: italic;
}

/* --- Item controls --- */

.gas-shop-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gas-space-l);
    width: 100%;
    margin-top: var(--gas-space-xs);
}

.gas-shop-item-price-info {
    margin-top: var(--gas-space-s);
}

.gas-shop-price-with-discount {
    display: flex;
    flex-direction: column;
    gap: var(--gas-space-xs);
}

.gas-shop-discount-details {
    display: flex;
    gap: var(--gas-space-xs);
    flex-wrap: wrap;
}

.gas-shop-discount-badge {
    background: var(--gas-info);
    color: var(--gas-white);
    padding: 2px var(--gas-space-xs);
    border-radius: var(--gas-radius-s);
    font-size: var(--gas-text-xs);
    font-weight: var(--gas-weight-medium);
}

.gas-shop-item-quantity {
    text-align: center;
    min-width: 120px;
}

.gas-shop-quantity-select {
    width: 60px;
    padding: var(--gas-space-xs);
    border: 1px solid var(--gas-border-color);
    border-radius: var(--gas-radius-s);
    margin-top: var(--gas-space-xs);
}

.gas-shop-quantity-info {
    display: block;
    margin-top: var(--gas-space-xs);
    color: var(--gas-text-color-light);
    font-size: var(--gas-text-xs);
}

.gas-shop-quantity-fixed {
    font-weight: var(--gas-weight-medium);
    color: var(--gas-text-color-light);
}

.gas-shop-invitation-quantity {
    color: var(--gas-success);
    font-weight: var(--gas-weight-semi);
}

.gas-shop-invitation-info {
    color: var(--gas-success);
    font-style: italic;
}

.gas-shop-item-total {
    text-align: right;
    font-size: var(--gas-text-l);
    font-weight: var(--gas-weight-bold);
    color: var(--gas-text-color);
    min-width: 100px;
}

.gas-shop-item-actions {
    text-align: center;
}

.gas-shop-remove-item {
    background: var(--gas-danger);
    color: var(--gas-white);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: var(--gas-radius-full);
    cursor: pointer;
    font-size: var(--gas-text-l);
    line-height: 1;
    transition: background var(--gas-transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gas-shop-remove-item:hover {
    background: var(--gas-danger-dark);
}

/* --- Item messages --- */

.gas-shop-item-cart-message {
    width: 100%;
    margin: 0;
    padding: var(--gas-space-s) var(--gas-space-m);
    background-color: var(--gas-info-light);
    border-left: 3px solid var(--gas-info);
    border-radius: var(--gas-radius-s);
    font-size: var(--gas-text-s);
}

.gas-shop-cart-message-icon {
    margin-right: var(--gas-space-s);
}

.gas-shop-cart-message-text {
    color: var(--gas-info-text);
}

/* --- Badge invitation dans le panier --- */

.gas-shop-item-invitation-badge {
    display: flex;
    align-items: center;
    gap: var(--gas-space-s);
    width: 100%;
    margin-top: var(--gas-space-s);
    padding: var(--gas-space-m);
    background: linear-gradient(135deg, hsl(48, 90%, 96%) 0%, var(--gas-warning-light) 100%);
    border: 2px solid var(--gas-warning);
    border-left: 5px solid hsl(32, 90%, 50%);
    border-radius: var(--gas-radius-m);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

.gas-invitation-text {
    flex: 1;
    color: var(--gas-warning-text);
    font-weight: var(--gas-weight-semi);
    font-size: var(--gas-text-s);
}

/* --- Badges info items --- */

.gas-shop-item-info-badges {
    width: 100%;
    margin-top: var(--gas-space-s);
    display: flex;
    flex-direction: column;
    gap: var(--gas-space-s);
}

.gas-shop-info-badge {
    display: flex;
    align-items: center;
    gap: var(--gas-space-s);
    padding: var(--gas-space-s) var(--gas-space-m);
    border-radius: var(--gas-radius-s);
    font-size: var(--gas-text-s);
    line-height: var(--gas-leading-normal);
}

.gas-badge-icon {
    font-size: var(--gas-text-l);
    flex-shrink: 0;
}

.gas-badge-text { flex: 1; }

.gas-shop-badge-info    { background: var(--gas-info-light);    color: var(--gas-info-text);    border: 1px solid var(--gas-info);    }
.gas-shop-badge-success { background: var(--gas-success-light);  color: var(--gas-success-text); border: 1px solid var(--gas-success);  }
.gas-shop-badge-warning { background: var(--gas-warning-light);  color: var(--gas-warning-text); border: 1px solid var(--gas-warning);  }
.gas-shop-badge-danger  { background: var(--gas-danger-light);   color: var(--gas-danger);  border: 1px solid var(--gas-danger);   }

.gas-shop-badge-login-prompt {
    background: linear-gradient(135deg, var(--gas-info-light) 0%, var(--gas-info-lighter) 100%);
    color: var(--gas-info-dark);
    border: 1px solid hsl(205, 75%, 78%);
}

@keyframes gas-pulse-icon {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

.gas-shop-badge-login-prompt .gas-badge-icon {
    animation: gas-pulse-icon 2s infinite;
}

/* --- Notice tarification dans le panier --- */

.gas-shop-pricing-notice-cart {
    display: flex;
    align-items: center;
    gap: var(--gas-space-s);
    width: 100%;
    margin-top: var(--gas-space-s);
    padding: var(--gas-space-m);
    background: linear-gradient(135deg, var(--gas-warning-light) 0%, var(--gas-warning-lighter) 100%);
    border-left: 4px solid var(--gas-warning);
    border-radius: var(--gas-radius-s);
    font-size: var(--gas-text-s);
    color: var(--gas-warning-text);
}

/* --- Tickets gratuits dans le panier --- */

.gas-shop-free-tickets-cart-info {
    width: 100%;
    margin-top: var(--gas-space-m);
    padding: var(--gas-space-m);
    background: linear-gradient(135deg, var(--gas-success-light) 0%, hsl(152, 56%, 88%) 100%);
    border: 2px solid var(--gas-success);
    border-radius: var(--gas-radius-m);
}

.gas-shop-free-tickets-summary {
    display: flex;
    align-items: center;
    gap: var(--gas-space-s);
    margin-bottom: var(--gas-space-s);
}

.gas-free-tickets-icon {
    font-size: var(--gas-text-xl);
    flex-shrink: 0;
}

.gas-free-tickets-text {
    flex: 1;
    color: var(--gas-success-text);
    font-size: var(--gas-text-m);
    line-height: var(--gas-leading-normal);
}

.gas-free-tickets-text strong {
    font-weight: var(--gas-weight-semi);
}

.gas-shop-free-tickets-progress {
    padding-left: 30px;
    color: var(--gas-success-text);
}

.gas-shop-free-tickets-progress small {
    font-size: var(--gas-text-xs);
    font-style: italic;
}

/* ==========================================================================
   RÉCAPITULATIF / SUMMARY
   ========================================================================== */

.gas-shop-panier-summary {
    background: var(--gas-white);
    border: 1px solid var(--gas-border-color);
    border-radius: var(--gas-radius-m);
    padding: var(--gas-space-l);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.gas-shop-total-section {
    border-bottom: 1px solid var(--gas-border-color);
    padding-bottom: var(--gas-space-m);
    margin-bottom: var(--gas-space-l);
}

.gas-shop-subtotal,
.gas-shop-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--gas-space-s);
    gap: var(--gas-space-m);
}

.gas-shop-subtotal > span:first-child,
.gas-shop-total   > span:first-child {
    flex: 1;
    min-width: 0;
}

.gas-shop-subtotal > strong,
.gas-shop-total   > strong {
    flex-shrink: 0;
    white-space: nowrap;
    text-align: right;
}

.gas-shop-total {
    font-size: var(--gas-text-xl);
    font-weight: var(--gas-weight-bold);
    color: var(--gas-text-color);
    border-top: 1px solid var(--gas-border-color);
    padding-top: var(--gas-space-s);
    margin-top: var(--gas-space-s);
    margin-bottom: 0;
}

/* ==========================================================================
   ACTIONS CHECKOUT
   ========================================================================== */

.gas-shop-checkout-actions {
    display: flex;
    flex-direction: column;
    gap: var(--gas-space-s);
}

.gas-shop-checkout-button {
    background: var(--gas-success);
    color: var(--gas-white);
    text-decoration: none;
    padding: var(--gas-space-m) var(--gas-space-l);
    border-radius: var(--gas-radius-s);
    text-align: center;
    font-weight: var(--gas-weight-semi);
    font-size: var(--gas-text-l);
    transition: all var(--gas-transition-normal);
}

.gas-shop-checkout-button:hover {
    background: var(--gas-success-dark);
    color: var(--gas-white);
    transform: translateY(-1px);
}

.gas-shop-continue-shopping-link {
    background: var(--gas-neutral-600);
    color: var(--gas-white);
    text-decoration: none;
    padding: var(--gas-space-s) var(--gas-space-l);
    border-radius: var(--gas-radius-s);
    text-align: center;
    font-weight: var(--gas-weight-medium);
    transition: background var(--gas-transition-normal);
}

.gas-shop-continue-shopping-link:hover {
    background: var(--gas-neutral-700);
    color: var(--gas-white);
}

.gas-shop-empty-cart-button {
    background: var(--gas-danger);
    color: var(--gas-white);
    border: none;
    padding: var(--gas-space-s) var(--gas-space-l);
    border-radius: var(--gas-radius-s);
    text-align: center;
    font-weight: var(--gas-weight-medium);
    font-size: var(--gas-text-s);
    cursor: pointer;
    transition: all var(--gas-transition-normal);
    width: 100%;
}

.gas-shop-empty-cart-button:hover:not(:disabled) {
    background: hsl(0, 65%, 40%);
    transform: translateY(-1px);
}

.gas-shop-empty-cart-button:disabled {
    background: var(--gas-neutral-500);
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   LOADER PANIER (vidage)
   ========================================================================== */

.gas-cart-action-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--gas-space-m);
    padding: var(--gas-space-2xl) var(--gas-space-l);
    background: linear-gradient(135deg, var(--gas-bg-surface-alt) 0%, var(--gas-neutral-200) 100%);
    border-radius: var(--gas-radius-m);
    margin-bottom: var(--gas-space-l);
    animation: gas-fade-in 0.3s ease;
}

.gas-loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gas-neutral-200);
    border-top-color: var(--gas-info);
    border-radius: var(--gas-radius-full);
    animation: gas-spin 0.8s linear infinite;
}

@keyframes gas-spin {
    to { transform: rotate(360deg); }
}

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

.gas-cart-action-loader p {
    margin: 0;
    color: var(--gas-text-color);
    font-size: var(--gas-text-l);
    font-weight: var(--gas-weight-semi);
}

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

@media (max-width: 768px) {
    .gas-shop-panier-container {
        padding: var(--gas-space-m);
    }

    .gas-shop-panier-content {
        grid-template-columns: 1fr;
        gap: var(--gas-space-l);
    }

    .gas-shop-item-header {
        flex-direction: column;
    }

    .gas-shop-item-image img {
        width: 100%;
        height: 150px;
        max-width: 200px;
        margin: 0 auto;
        display: block;
    }

    .gas-shop-item-quantity,
    .gas-shop-item-total {
        text-align: left;
    }

    .gas-shop-item-actions {
        text-align: center;
    }

    .gas-shop-global-info-message {
        flex-direction: column;
        text-align: center;
    }

    .gas-info-icon {
        font-size: 32px;
    }

    .gas-shop-info-badge {
        flex-direction: column;
        text-align: center;
        gap: var(--gas-space-xs);
    }

    .gas-badge-icon {
        font-size: var(--gas-text-2xl);
    }

    .gas-shop-item-invitation-badge {
        padding: var(--gas-space-s) var(--gas-space-m);
    }
}