/**
 * Product Subscription - Front CSS
 */

/* =============================================
   Product Page - Subscribe Box
   ============================================= */

.product-subscription-box {
    margin-top: 20px;
    border: 2px solid #e9ecf2;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.subscription-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #e9ecf2;
    border-bottom: 1px solid #ddd;
}

.subscription-header i {
    color: #2fb5d2;
    font-size: 18px;
}

.subscription-title {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.subscription-discount {
    background: #2fb5d2;
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.subscription-content {
    padding: 15px;
}

.subscription-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.subscription-frequency {
    margin-bottom: 15px;
}

.subscription-frequency label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.frequency-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.frequency-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.frequency-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #2fb5d2;
}

.frequency-label {
    font-size: 14px;
}

.btn-subscription {
    width: 100%;
    background: #2fb5d2;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-subscription:hover {
    background: #249db8;
    color: #fff;
}

.subscription-message {
    margin-top: 15px;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 13px;
}

.subscription-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.subscription-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.subscription-login-required {
    text-align: center;
}

.subscription-login-required p {
    margin-bottom: 10px;
    color: #666;
}

/* =============================================
   My Account - Subscriptions Page
   ============================================= */

.subscriptions-page {
    margin-bottom: 30px;
}

.subscriptions-section {
    margin-bottom: 30px;
}

.subscriptions-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecf2;
}

.subscriptions-section-title i {
    font-size: 20px;
}

.subscriptions-section-title .badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
}

.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subscriptions-cancelled .subscription-card {
    opacity: 0.7;
}

/* Subscription Card */
.subscription-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e9ecf2;
    border-radius: 8px;
    transition: box-shadow 0.3s;
}

.subscription-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.subscription-card-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
}

.subscription-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 5px;
}

.subscription-card-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 5px;
    color: #ccc;
    font-size: 24px;
}

.subscription-card-content {
    flex: 1;
    min-width: 0;
}

.subscription-card-content .product-name {
    font-size: 16px;
    margin-bottom: 10px;
}

.subscription-card-content .product-name a {
    color: #333;
    text-decoration: none;
}

.subscription-card-content .product-name a:hover {
    color: #2fb5d2;
}

.subscription-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    font-size: 13px;
}

.detail-row {
    display: flex;
    gap: 5px;
}

.detail-label {
    color: #666;
}

.detail-value {
    font-weight: 500;
}

.detail-value.next-delivery {
    color: #2fb5d2;
    font-weight: 600;
}

.detail-value.discount {
    color: #28a745;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-active {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-paused {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.subscription-card-actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subscription-card-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    padding: 6px 12px;
}

.subscription-card-actions .btn i {
    font-size: 12px;
}

.subscription-card-actions .action-form {
    display: inline;
}

/* =============================================
   Manage Subscription Page
   ============================================= */

.subscription-manage-page {
    max-width: 700px;
    margin: 0 auto;
}

.subscription-manage-card {
    background: #fff;
    border: 1px solid #e9ecf2;
    border-radius: 8px;
    overflow: hidden;
}

.manage-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecf2;
}

.manage-header .product-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.manage-header .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 5px;
}

.manage-header .product-info {
    flex: 1;
}

.manage-header .product-name {
    font-size: 20px;
    margin-bottom: 10px;
}

.manage-header .product-name a {
    color: #333;
    text-decoration: none;
}

.subscription-meta {
    display: flex;
    gap: 10px;
}

.discount-badge {
    display: inline-block;
    background: #28a745;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.manage-body {
    padding: 20px;
}

.manage-body h3 {
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecf2;
}

.current-settings {
    margin-bottom: 30px;
}

.current-settings .table {
    width: 100%;
    margin-bottom: 0;
}

.current-settings .table th {
    width: 40%;
    font-weight: 500;
    color: #666;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.current-settings .table td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.modify-settings {
    margin-bottom: 30px;
}

.modify-settings .form-group {
    margin-bottom: 15px;
}

.modify-settings label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.subscription-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecf2;
}

.actions-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-form {
    display: inline-block;
}

.back-link {
    margin-top: 20px;
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
}

.back-link a:hover {
    color: #2fb5d2;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
    .subscription-card {
        flex-direction: column;
        text-align: center;
    }

    .subscription-card-content {
        width: 100%;
    }

    .subscription-details {
        justify-content: center;
    }

    .subscription-card-actions {
        width: 100%;
    }

    .subscription-card-actions .btn {
        width: 100%;
    }

    .manage-header {
        flex-direction: column;
        text-align: center;
    }

    .subscription-meta {
        justify-content: center;
    }

    .actions-buttons {
        flex-direction: column;
    }

    .action-form {
        width: 100%;
    }

    .action-form .btn {
        width: 100%;
    }
}
