/* Shared Components CSS - Composants réutilisables */

/* === CONTAINERS COMMUNS === */
.container-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-medium {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === SECTIONS COMMUNES === */
.section-padding {
    padding: 80px 0;
}

.section-padding-small {
    padding: 60px 0;
}

.section-bg-white {
    background: white;
}

.section-bg-light {
    background: #f8f9fa;
}

.section-bg-gradient {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

/* === HERO SECTIONS === */
.hero-base {
    background: linear-gradient(135deg, #b8956d 0%, #a68659 50%, #94724a 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-base::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.3;
}

.hero-content-base {
    position: relative;
    z-index: 1;
}

.hero-title-base {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-subtitle-base {
    color: rgba(255,255,255,0.9);
    line-height: 1.6;
    margin-bottom: 40px;
}

/* === TITRES DE SECTIONS === */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 50px;
    font-weight: 600;
}

/* === BOUTONS CTA === */
.cta-btn {
    background: white;
    color: #b8956d;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    text-decoration: none;
    color: #a68659;
}

.cta-btn.secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.cta-btn.secondary:hover {
    background: white;
    color: #b8956d;
}

.cta-btn.small {
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 25px;
}

/* Groupe de boutons */
.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === CARDS COMMUNES === */
.card-base {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-base:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.card-center {
    text-align: center;
}

.card-feature {
    background: white;
    border-radius: 15px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card-feature:hover {
    transform: translateY(-5px);
}

/* === ICÔNES === */
.icon-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #b8956d, #a68659);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    color: white;
    font-size: 2rem;
}

.icon-circle.large {
    font-size: 2.2rem;
}

/* === GRILLES COMMUNES === */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.grid-auto-fit.small {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.grid-auto-fit.large {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

/* === TEXTES COMMUNS === */
.text-center {
    text-align: center;
}

.text-large {
    font-size: 1.1rem;
    line-height: 1.7;
}

.text-medium {
    font-size: 1rem;
    line-height: 1.6;
}

.text-muted {
    color: #666;
}

.text-primary {
    color: #b8956d;
}

/* === STATS/NUMBERS === */
.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #b8956d;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-description {
    color: #333;
    margin-top: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* === TITRES HIÉRARCHIQUES === */
.title-xl {
    font-size: 3.5rem;
}

.title-lg {
    font-size: 3rem;
}

.title-md {
    font-size: 2rem;
}

.title-sm {
    font-size: 1.5rem;
}

.title-feature {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

/* === RESPONSIVE COMMUN === */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .title-xl {
        font-size: 2.5rem;
    }

    .title-lg {
        font-size: 2.2rem;
    }

    .grid-auto-fit,
    .grid-auto-fit.small,
    .grid-auto-fit.large {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .grid-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .card-base,
    .card-feature {
        padding: 30px 20px;
    }

    .container-section,
    .container-narrow,
    .container-medium {
        padding: 0 15px;
    }
}

/* === TOGGLE SWITCH (iOS-style) === */
.toggle-switch {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 56px;
    height: 32px;
    background-color: #e0e0e0;
    border-radius: 16px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    margin: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    display:none;
}

.toggle-switch:checked {
    background-color: #28a745;
}

.toggle-switch:checked::after {
    transform: translateX(24px);
}

.toggle-switch:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.toggle-switch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Variantes de couleur pour le toggle switch */
.toggle-switch.toggle-primary:checked {
    background-color: #b8956d;
}

.toggle-switch.toggle-primary:focus {
    box-shadow: 0 0 0 3px rgba(184, 149, 109, 0.2);
}

.toggle-switch.toggle-danger:checked {
    background-color: #dc3545;
}

.toggle-switch.toggle-danger:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.toggle-switch.toggle-warning:checked {
    background-color: #ffc107;
}

.toggle-switch.toggle-warning:focus {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

.toggle-switch.toggle-info:checked {
    background-color: #17a2b8;
}

.toggle-switch.toggle-info:focus {
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.2);
}

/* === MODAL DE CONFIRMATION === */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    padding: 20px;
}

.confirm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.confirm-modal-overlay.active .confirm-modal {
    transform: scale(1) translateY(0);
}

.confirm-modal-header {
    padding: 24px 24px 16px;
    text-align: center;
}

.confirm-modal-icon {
    font-size: 3rem;
    color: #dc3545;
    margin-bottom: 12px;
    display: block;
}

.confirm-modal-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
}

.confirm-modal-body {
    padding: 0 24px 24px;
    text-align: center;
}

.confirm-modal-message {
    margin: 0;
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
}

.confirm-modal-footer {
    display: flex;
    border-top: 1px solid #eee;
}

.confirm-modal-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.confirm-modal-cancel {
    background: #f8f9fa;
    color: #666;
    border-right: 1px solid #eee;
}

.confirm-modal-cancel:hover {
    background: #e9ecef;
}

.confirm-modal-confirm {
    background: #b8956d;
    color: white;
}

.confirm-modal-confirm:hover {
    background: #a68659;
}

.confirm-modal-confirm.confirm-modal-danger {
    background: #dc3545;
}

.confirm-modal-confirm.confirm-modal-danger:hover {
    background: #c82333;
}

.confirm-modal-confirm.confirm-modal-success {
    background: #28a745;
}

.confirm-modal-confirm.confirm-modal-success:hover {
    background: #218838;
}

/* Responsive modal */
@media (max-width: 480px) {
    .confirm-modal-overlay {
        padding: 16px;
    }

    .confirm-modal {
        max-width: 100%;
    }

    .confirm-modal-header {
        padding: 20px 20px 12px;
    }

    .confirm-modal-icon {
        font-size: 2.5rem;
    }

    .confirm-modal-title {
        font-size: 1.2rem;
    }

    .confirm-modal-body {
        padding: 0 20px 20px;
    }

    .confirm-modal-message {
        font-size: 0.95rem;
    }

    .confirm-modal-btn {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
}

/* === QUANTITY WIDGET === */
.quantity-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.quantity-field {
    flex: 0 0 120px;
}

.quantity-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700, #374151);
    font-size: 0.9rem;
}

.quantity-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300, #dee2e6);
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.quantity-field input:focus {
    outline: none;
    border-color: var(--primary-gold, #b8956d);
    box-shadow: 0 0 0 3px rgba(184, 149, 109, 0.2);
}

.unit-field {
    flex: 1;
}

.unit-field > label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700, #374151);
    font-size: 0.9rem;
}

.unit-radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.unit-radio {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid var(--gray-300, #dee2e6);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white, #ffffff);
    min-width: 70px;
    text-align: center;
}

.unit-radio:hover {
    border-color: var(--primary-gold, #b8956d);
    background: var(--gray-100, #f8f9fa);
}

.unit-radio:has(input:checked) {
    border-color: var(--primary-gold, #b8956d);
    background: var(--primary-gold-lighter, #f2eee4);
    box-shadow: 0 2px 8px rgba(184, 149, 109, 0.2);
}

/* === SEARCHABLE SELECT === */
.searchable-select {
    position: relative;
    max-width: 100%;
}

.searchable-select__input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--gray-300, #dee2e6);
    border-radius: 8px;
    background: var(--white, #ffffff);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.searchable-select__input:focus {
    outline: none;
    border-color: var(--primary-gold, #b8956d);
    box-shadow: 0 0 0 3px rgba(184, 149, 109, 0.2);
}

.searchable-select__select {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    background: var(--white, #ffffff);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 10px 24px rgba(44, 62, 80, 0.12);
    padding: 6px;
}

.searchable-select.is-open .searchable-select__select {
    display: block;
}

.searchable-select__select option {
    padding: 8px 10px;
    border-radius: 6px;
    margin: 2px 0;
}

.searchable-select__select option:checked {
    background: var(--primary-gold, #b8956d) linear-gradient(0deg, var(--primary-gold, #b8956d), var(--primary-gold, #b8956d));
    color: var(--white, #ffffff);
}

.unit-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.unit-radio-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800, #212529);
    margin-bottom: 4px;
}

.unit-radio:has(input:checked) .unit-radio-label {
    color: var(--primary-gold-dark, #a68659);
}

.unit-radio-desc {
    font-size: 0.75rem;
    color: var(--gray-600, #6c757d);
    text-transform: lowercase;
}

.unit-radio:has(input:checked) .unit-radio-desc {
    color: var(--primary-gold, #b8956d);
}

/* Responsive quantity widget */
@media (max-width: 480px) {
    .quantity-row {
        flex-direction: column;
        gap: 16px;
    }

    .quantity-field {
        flex: 1 1 auto;
        width: 100%;
    }

    .unit-radio-group {
        justify-content: space-between;
    }

    .unit-radio {
        flex: 1;
        min-width: unset;
        padding: 10px 12px;
    }
}

/* Quantity widget inline variant (pour formulaires en ligne) */
.add-item-form-container .quantity-row {
    display: contents;
}

.add-item-form-container .quantity-field {
    min-width: 100px;
}

.add-item-form-container .unit-field {
    min-width: auto;
}

.add-item-form-container .unit-radio-group {
    flex-direction: row;
    gap: 8px;
}

.add-item-form-container .unit-radio {
    padding: 8px 12px;
    min-width: 55px;
}

.add-item-form-container .unit-radio-label {
    font-size: 1rem;
    margin-bottom: 2px;
}

.add-item-form-container .unit-radio-desc {
    font-size: 0.7rem;
}

/* === SIGNUP WALL MODAL === */
.signup-wall-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.signup-wall-overlay.active {
    opacity: 1;
    visibility: visible;
}

.signup-wall-modal {
    background: white;
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
    position: relative;
}

.signup-wall-overlay.active .signup-wall-modal {
    transform: scale(1) translateY(0);
}

.signup-wall-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.signup-wall-close:hover {
    color: #333;
}

.signup-wall-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #b8956d, #a68659);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    color: white;
    font-size: 2rem;
}

.signup-wall-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 15px 0;
}

.signup-wall-message {
    color: #666;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 30px 0;
}

.signup-wall-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.signup-wall-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.signup-wall-google {
    background: white;
    color: #333;
    border: 2px solid #e0e0e0;
}

.signup-wall-google:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.signup-wall-facebook {
    background: #1877F2;
    color: white;
    border: 2px solid #1877F2;
}

.signup-wall-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
}

.signup-wall-footer {
    color: #999;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.4;
}

.signup-wall-footer a {
    color: #b8956d;
    text-decoration: none;
}

.signup-wall-footer a:hover {
    text-decoration: underline;
}

/* Responsive signup wall */
@media (max-width: 480px) {
    .signup-wall-modal {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .signup-wall-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }

    .signup-wall-title {
        font-size: 1.4rem;
    }

    .signup-wall-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}
